While trying to format my USB key, I accidentally selected /dev/sda and proceeded to format the disk. Luckily, the formatting was interrupted when GParted noticed the drive was currently mounted. However, I can't see the partitions anymore (even when I restart GParted, I keep seeing this):
I haven't rebooted yet as I am afraid to do so. At the moment, I can use my filesystem just fine but I'm afraid that if I reboot some bad things might happen. What can I do to fix this? Is it safe to reboot?
UPDATE:
I was attempting to create a bootable USB key for Windows 7 so I clicked Device/Create partition table and selected "msdos". I then attempted to create a primarty partition (NTFS) and got an error due to the fact that /dev/sda was already mounted. I'm not sure where I can get an exact log. Here's the output of sudo fdisk -l
:
➜ ~ sudo fdisk -l
[sudo] password for olalonde:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001db65
Device Boot Start End Blocks Id System
/dev/sda1 1 60801 488384001 7 HPFS/NTFS
Disk /dev/sdb: 7998 MB, 7998537728 bytes
255 heads, 63 sectors/track, 972 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005e98c
Device Boot Start End Blocks Id System
/dev/sdb1 1 972 7807558+ 7 HPFS/NTFS
As I said, my file system is correctly mounted so I can backup all my files but I'd rather not go through that lengthy process if it is safe to reboot or if there's a way to fix this before rebooting...
UPDATE 2:
Output of mount
and cat /proc/mounts
:
➜ ~ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/home/olalonde/.Private on /home/olalonde type ecryptfs (ecryptfs_check_dev_ruid,ecryptfs_sig=ee352762b400fa23,ecryptfs_fnek_sig=70e5eee62e053b1b,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs)
gvfs-fuse-daemon on /home/olalonde/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=olalonde)
/dev/sda1 on /mnt type ext4 (rw)
➜ ~ cat /proc/mounts
rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
none /dev devtmpfs rw,relatime,size=2005108k,nr_inodes=501277,mode=755 0 0
none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
/dev/disk/by-uuid/bbf66c3f-ae71-4389-9f83-282e95ce6ee9 / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
none /var/run tmpfs rw,nosuid,relatime,mode=755 0 0
none /var/lock tmpfs rw,nosuid,nodev,noexec,relatime 0 0
none /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
/home/olalonde/.Private /home/olalonde ecryptfs rw,relatime,ecryptfs_fnek_sig=70e5eee62e053b1b,ecryptfs_sig=ee352762b400fa23,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs 0 0
gvfs-fuse-daemon /home/olalonde/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
/dev/sda1 /mnt ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0
UPDATE 3:
I am trying to use testdisk
. Can anyone confirm that I'm doing this right and whether I should click that scary looking "Write"?
(selected N)
sudo mount /dev/sda1 /mnt
successfully mount the filesystem on/mnt
? gparted should keep a log of what it did, but it is lost when you close gparted, unless you chose "Save details".gparted
. What is the output ofsudo fdisk -l
? It should be easy to save/restore the in-memory layout ofsda
. However if at all possible I would back up the important stuff to an external drive/another disk/etc. without rebooting.