PDA

View Full Version : Edit fstab from Live CD



sarah_b
09-02-2006, 03:44 PM
I was tweaking my Ubuntu fstab and I messed up.

I am using Knoppix 4.0.2 CD, in a terminal I entered this: Sudo mcedit /dev/hdb6/ect/fstab

I was able to edit my fstab but when I tried to save it I could not using F2 or the drop down menu.
What am I missing, does anyone know what I may be doing wrong ? This is my work computer and I would be forever grateful if someone could help me please......

sarah

ockham23
09-02-2006, 04:29 PM
Boot off the Knoppix cd and launch a shell:
su
mkdir /media/hdb6
mount -o rw /dev/hdb6 /media/hdb6
mcedit /media/hdb6/etc/fstab
umount /media/hdb6

sarah_b
09-02-2006, 05:44 PM
mkdir /media/hdb6
I get this: can not create directory /media/hdb6, no such file or directory


mount -o rw /dev/hdb6 /media/hdb6
mount point /media/hdb6 does not exist


mount /dev/hdb6
mount /dev/hdb6 already mounted or busy

ockham23
09-02-2006, 06:16 PM
Did you boot off the Knoppix cd without clicking on any of the hard drive icons on the desktop?
Did you enter "su" as first command?
Is your existing Ubuntu install located on hdb6 = 6th partition on the secondary hard drive?

Harry Kuhman
09-02-2006, 06:22 PM
Is your existing Ubuntu install located on hdb6 = 6th partition on the secondary hard drive?
More precisely, the second logical drive on the extended partition. Even with 1 primary partition and one exteded partition containing as few as 2 logical drives, the first logical drive on the second (slave) disk on the first IDE controler would be hdb5 and the second logical drive would be hdb6.

sarah_b
09-02-2006, 06:31 PM
Did you boot off the Knoppix cd without clicking on any of the hard drive icons on the desktop?

Now you have a good question there, I do not remember if I did or did not open up the hdb6 icon. Is this important ?


Did you enter "su" as first command?
I can answer yes to this



Is your existing Ubuntu install located on hdb6 = 6th partition on the secondary hard drive?
yes again....

ockham23
09-02-2006, 06:39 PM
I assumed you were somewhat familiar with linux commands. Here's an explanation:

su # become root

mkdir /media/hdb6 # create mount point "hdb6" inside directory "media"; assuming mount point doesn't exist already

mount -o rw /dev/hdb6 /media/hdb6 # mount hdb6 and make it writable; clicking on the desktop icon will mount the drive "read only"

mcedit /media/hdb6/etc/fstab # launch editor

umount /media/hdb6 # unmount partition when you're done

sarah_b
09-02-2006, 06:43 PM
Is your existing Ubuntu install located on hdb6 = 6th partition on the secondary hard drive?
More precisely, the second logical drive on the extended partition. Even with 1 primary partition and one exteded partition containing as few as 2 logical drives, the first logical drive on the second (slave) disk on the first IDE controler would be hdb5 and the second logical drive would be hdb6.

here is what I have, with Ubuntu on hdb6:

/dev/hdb1 reiserfs 13.97 GB

/dev/hdb2 extended 19.75 GB
/dev/hdb5 linux swap 1.12 GB
/dev/hdb6 boot 18.63 GB

/dev/hdb3 reiserfs 19.53 GB
/dev/hdb4 reiserfs 21.27 GB

sarah_b
09-02-2006, 06:47 PM
I assumed you were somewhat familiar with linux commands

ok, let me try booting Knoppix CD again and I will make sure I have not clicked on the hdb6 icon, I'll be back.......

regards,
sarah

sarah_b
09-02-2006, 07:14 PM
ockham23,

thank you for the commands explaination, I am under average using linux commands, I have a personal file that I have saved my most important commands, I do a lot of copy and pasting. I wasted about a year with Linspire, (no commands needed) and have been using Ubuntu for about a year and love it.

But anyway, I booted Knoppix up again, made sure I did not open the hdb6 icon, then opened a terminal and tried your commands again but had the same results again as before.

ockham23
09-02-2006, 07:18 PM
ls /mediaMaybe there's no "/media" directory. Replace "/media" with "/mnt" and try again.

sarah_b
09-02-2006, 07:31 PM
ls /media

Let me explain how I got to this point in the first place. I had two partitions that Ubuntu nautilus could not see, hdb3 & hdb4. Gparted could see them. I finally got Ubuntu to recognize them, but then I could not get permssion. That was when I started tweaking fstab and the next boot failed, I could not and still can not boot into Ubuntu. That is why I am trying to edit fstab from a live CD. About the command above, do I use that command in knoppix seeing I can not boot Ubuntu or were you assuming I could boot in to Ubuntu ?

ockham23
09-02-2006, 07:34 PM
This is from Knoppix, just to list the contents of /media. And, while you're at it, you could post the output of
sudo fdisk -l

sarah_b
09-02-2006, 07:55 PM
root@0[knoppix]# fdisk -l

Disk /dev/hda: 30.0 GB, 30020272128 bytes
255 heads, 63 sectors/track, 3649 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3648 29302528+ c W95 FAT32 (LBA)

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 1824 14651248+ 83 Linux
/dev/hdb2 1825 4402 20707785 5 Extended
/dev/hdb3 4403 6952 20482875 83 Linux
/dev/hdb4 6953 9729 22306252+ 83 Linux
/dev/hdb5 1825 1970 1172713+ 82 Linux swap / Solaris
/dev/hdb6 * 1971 4402 19535008+ 83 Linux

Disk /dev/sda: 259 MB, 259522560 bytes
65 heads, 32 sectors/track, 243 cylinders
Units = cylinders of 2080 * 512 = 1064960 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 244 253424 4 FAT16 <32M
Partition 1 has different physical/logical endings:
phys=(249, 64, 32) logical=(243, 44, 32)

-------------------------------------------------------------------------------------------------------------------------------------

root@1[knoppix]# ls /media
ls: /media: No such file or directory

ockham23
09-02-2006, 08:02 PM
ls: /media: No such file or directoryIs this Knoppix 4.0 or an older version? Ok, check whether directory "/mnt" exists. If so, the commands are
su
mkdir /mnt/hdb6
mount -o rw /dev/hdb6 /mnt/hdb6
mcedit /mnt/hdb6/etc/fstab
umount /mnt/hdb6

sarah_b
09-02-2006, 08:07 PM
[quote]Is this Knoppix 4.0 or an older version?

Knoppix 4.0.2

ockham23
09-02-2006, 08:10 PM
Strange, I have 4.0.1 and mount points are in /media. Anyway, /mnt will do as well (if it exists, that is).

rusty
09-02-2006, 08:21 PM
Try this,

When you get the knoppix boot screen, type: knoppix 2, this will bott you into a command line and you are root.

Now from the command line, type: startx, this will start the xsession and you should be able to proceed, as root, in a graphical mode to peruse your partitions and edit /etc/fstab, wherever it may be without sudo first.

HTH

sarah_b
09-02-2006, 08:50 PM
ls: /media: No such file or directoryIs this Knoppix 4.0 or an older version? Ok, check whether directory "/mnt" exists. If so, the commands are
su
mkdir /mnt/hdb6
mount -o rw /dev/hdb6 /mnt/hdb6
mcedit /mnt/hdb6/etc/fstab
umount /mnt/hdb6

ok, good deal, I was able to access, edit and save my changes in hdb6 fstab with the above commands. Thank you so much for being patient and walking me through this. I allready have this post and the commands added to my library.

This post can be closed,
the knoppix forums are great,
sarah

sarah_b
09-02-2006, 09:03 PM
Try this,

When you get the knoppix boot screen, type: knoppix 2, this will bott you into a command line and you are root.

Now from the command line, type: startx, this will start the xsession and you should be able to proceed, as root, in a graphical mode to peruse your partitions and edit /etc/fstab, wherever it may be without sudo first.HTH

This sounds interesting, thanks rusty I'll give it a try. I like graphic's.......

sarah