I have two ext partition on my linux
- One for
/
- And one for
/home
I wanted to reduce (with this method) the home partition (which was only something like 10% filled) to create a new partition for Windows.
Unfortunately it failed and when I wanted to reboot, linux went in rescue mode, which could have been helpfull unless this rescue mode was not working (It showed two password prompt, and then was working like there was two command prompt at the same time [I had to double every letter to make a command like : ccwwdd //eettcc
], so not really doable).
My question is : Can I boot to this linux anyway without going in rescue mode? Like for example disabling this partition (/etc/fstab
?).
Also is it possible to repair this partition ? (When I try to mount it with Ext2Fs it says RAW
in partition type)
Here is the parted info :
Model: ATA ST9640320AS (scsi)
Disk /dev/sda: 640GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 100GB 100GB primary ext4
2 100GB 420GB 320GB extended
5 100GB 110GB 9999MB logical linux-swap(v1)
6 110GB 420GB 310GB logical
3 420GB 420GB 367MB primary ntfs boot
4 420GB 640GB 220GB primary ntfs
I think the /home
partition is /dev/sda6
Fsck output :
ubuntu@ubuntu:~$ sudo fsck.ext4 /dev/sda6
e2fsck 1.42.9 (4-Feb-2014)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/sda6
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Command output :
ubuntu@ubuntu:~$ findmnt;lsblk -f;sudo partx -svb /dev/sda -oNR,START,END,SECTORS,NAME,FLAGS,SCHEMETARGET SOURCE FSTYPE OPTIONS
/ /cow overlayfs rw,relatime,lowerdir=//filesystem.squashfs,upperdir=/cow
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup tmpfs rw,relatime,size=4k,mode=755
│ │ └─/sys/fs/cgroup/systemd systemd cgroup rw,nosuid,nodev,noexec,relatime,name=systemd
│ ├─/sys/fs/fuse/connections fusectl rw,relatime
│ ├─/sys/kernel/debug debugfs rw,relatime
│ ├─/sys/kernel/security securityfs rw,relatime
│ └─/sys/fs/pstore pstore rw,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
├─/dev udev devtmpfs rw,relatime,size=1977152k,nr_inodes=207544,mode=755
│ └─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
├─/run tmpfs tmpfs rw,nosuid,noexec,relatime,size=397492k,mode=755
│ ├─/run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k
│ ├─/run/shm tmpfs rw,nosuid,nodev,relatime
│ └─/run/user tmpfs rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755
│ └─/run/user/999/gvfs gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=999,group_id=999
├─/cdrom /dev/sdb1 vfat ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
├─/rofs /dev/loop0 squashfs ro,noatime
├─/tmp tmpfs tmpfs rw,nosuid,nodev,relatime
└─/media/ubuntu/04A874F6A874E796 /dev/sda4 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096
NAME FSTYPE LABEL MOUNTPOINT
sda
├─sda1
├─sda2
├─sda3
├─sda4 /media/ubuntu/04A874F6A874E796
├─sda5 [SWAP]
└─sda6
sdb
└─sdb1 /cdrom
sr0
loop0 /rofs
partition: none, disk: /dev/sda, lower: 0, upper: 0
/dev/sda: partition table type 'dos' detected
NR START END SECTORS NAME FLAGS SCHEME
1 2048 195311615 195309568 0x0 dos
2 195313662 820317176 625003515 0x0 dos
3 820318208 821035007 716800 0x80 dos
4 821035008 1250260991 429225984 0x0 dos
5 195313664 214843391 19529728 0x0 dos
6 214843455 820317176 605473722 0x0 dos
sudo parted --list
. – Braiam Aug 17 '14 at 21:02wipefs
. Almost definitely there will be backup superblocks distributed elsewhere on the disk and you can detect them and possibly restore them withwipefs
- it's probably already installed. – mikeserv Aug 17 '14 at 22:33man
page I linked and read the other answer I linked. I will try to help if I might, but, from afar, it's important that you understand what's going on. The question doesn't provide enough info to be sure - only to guess - and I don't wanna screw up your disk. – mikeserv Aug 19 '14 at 13:48parted
, by the way. Can you do these three commands:findmnt;lsblk -f;sudo partx -svb /dev/sda -oNR,START,END,SECTORS,NAME,FLAGS,SCHEME
. Thepartx
one is the most important. Please do not dotestdisk
and PLEASE do not dofsck
again. I'm fairly certain the problem is only located in the first few megabytes of the disk, but it may be that in order to restore that you have to look kind of blindly elsewhere. If those programs do not understand the filesystem they're looking at - they might overwrite stuff. A very small change could be dramatic. – mikeserv Aug 19 '14 at 14:01testdisk
only to save some file (which mean thattestdisk
know how to read this partition) – PeterFour Aug 19 '14 at 15:07gparted
? It's a quite nice GUI, i use it all the time from Knoppix live CD. – LatinSuD Aug 19 '14 at 16:02/home
and shrunk it. Afakin it should be harmless to booting. – LatinSuD Aug 19 '14 at 16:10testdisk
. It just worked for me several times over with screwed up disk images. You should try to backup first if you can. If you have another disk at all the best thing to do is to write and image of your disk to another and use it for your recovery testing. – mikeserv Aug 19 '14 at 20:07