Mounting hard drive from Linux Live CD
Did something stupid, and messed up my /etc/fstab by putting barrier=0 as an option to to my root directory. So, I booted from a Linux Live CD. My Linux distributor is Centos.
Did fdisk -l, and see /dev/sda being 1500 GB and assume it is my HD. It shows /dev/sda1 (which evidently does not end on cylinder boundary), and /dev/sda2. It also shows /dev/dm-0 and /dev/dm-1, and says both do not contain a valid partition type. I mount sda1, and think it is the /boot of my hard drive, and cannot get to /etc/fstab and fix it. I then try to mount sda2, but get "mount: /dev/sda2 already mounted or /mnt/sda busy". So, I try to umount /dev/sda2, but am told it is not mounted. I then do mount, and see /dev/mapper/live-rw (the CD), /proc, /sys, /dev/pts, /dev/shm, and /proc/sys/fs/binfmt_misc. No sda2. Can anyone help? |
I believe CentOS uses LVM for the root partition. Try mounting one of the /dev/dm-n devices.
|
Thank you!!!
dm0 is my hard drive and dm1 is I think the CD. Other than asking, how should I have known this? PS. Can't edit fstab cause I don't have vi. Shouldn't be too hard to get... |
upon further review, dm-0 and dm-1 are both the CD. dm-0 is r/w and dm-1 is r only.
How do I access sda2? Thanks |
Use another live cd. Fedora ought to mount the local disks or you may have to say mount read as. Many other live cd's ought to be able to edit this file. The hard drive's data shouldn't affect how a live cd mounts it.
In almost every live cd, you can add in tools from network just like a normal install. KDE stuff ought to have kate or vi vim by default I'd think. |
Have you got the install media for your Centos? I always boot off that and select Rescue mode.
All the tools you need are there. |
Thanks jefro and chrism01,
I ended up successfully using the original install media, but since it was a url upload, it was a bit of a pain. I will probably end up creating a new lives cd. |
All times are GMT -5. The time now is 04:41 AM. |