Announcement

Collapse
No announcement yet.

HOWTO: Mount hard drive using live cd

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HOWTO: Mount hard drive using live cd

    I have read some posts where noobs have reinstalled kubuntu because of some problems that could have been fixed if they had known how to mount the hdd from the live cd.

    step 1: boot from a live cd. can be feisty, edgy, knoppix etc. etc.
    step 2: open konsole and:
    A: type sudo fdisk -l /dev/hda (sda for sata disk). If you have a dual
    boot system you will have to do sudo fdisk -l /dev/hdb or /sdb
    depending on which drive you wish to access.
    This will print the partition table.
    Sample below:

    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 1 131 1052226 82 Linux swap / Solaris
    /dev/sda2 132 588 3670852+ 83 Linux
    /dev/sda3 589 29126 229231485 83 Linux
    /dev/sda4 29127 30401 10241437+ 5 Extended
    /dev/sda5 29127 30401 10241406 83 Linux


    determine which partition is your hdd (usually /dev/hda or /dev/sda
    forsata disk) In this case /sda1 is swap, /sda2 is /var, /sda3
    is /home, and /sda5 is /. ( i know this because I installed it). fdisk will
    not show themount points.
    B: create directory or mount point for one or all partitions. All if you
    don't know which one you need to get to.
    sudo mkdir /media/name_of_hd (could be /media/windows
    or /media/home. In this case I would do /media/sda1 /media/sda2
    and so on for each partition.
    Step 3: edit /etc/fstab
    A: in konsole type kdesu kate /etc/fstab.
    This will open the fstab in the text editor. start a new line after the
    last entry. It may not look like it but there are 6 columns separated
    by spaces. 1st column is device, 2nd is mount point 3rd is file
    system type, 4th is permissions 5th and 6th are irrelevant for this
    tutorial. Sample below:

    unionfs / unionfs rw 0 0
    tmpfs /tmp tmpfs nosuid,nodev 0 0
    /dev/hda1 swap swap defaults 0 0
    (new lines)
    /dev/sda2 /media/sda2 ext3 defaults 0 0
    /dev/sda3 /media/sda3 ext3 defaults 0 0
    /dev/sda4 /media/sda4 ext3 defaults 0 0
    /dev/sda5 /media/sda5 ext3 defaults 0 0

    Notice i did not add a line for /dev/sda1 because it is swap
    according to fdisk above. Now save the new /etc/fstab by clicking
    on the save icon or >file>save.
    B: In konsole type sudo mount -a
    You will get errors if there are any misspellings in /etc/fstab or if you
    got the file system type on any of the lines wrong. If everthing is
    correct you should now be able to browse the partitions in
    konqueror or edit any of the files with kate or your favorite editor.

    I hope this is helpful.
    Charlie

    contrib by jankushka:
    content:
    you can look at the mounted file systems by issuing "df -h".
    where -h stands for "human readeable".

    you can look at the current mount table by issuing "mount".

    the 4th column of fstab is not "permissions", rather "mount options".
    I tried Enlightenment once, it was pretty cool.

    #2
    Re: HOWTO: Mount hardrive using live cd

    Here is a very good web site I have bookmarked.

    http://www.shockfamily.net/cedric/knoppix/

    I ALWAYS keep at least two distros installed on my computer. Each with an fstab entry to mount the file system of the other. If one crashes, I can just boot into the other, and have complete access to all the files.

    Comment


      #3
      Re: HOWTO: Mount hard drive using live cd

      Thanks for writing this, bootdoc!

      I gave myself a little refresher course just yesterday, by "inserting" a new SATA drive in my system, where of course it was numbered IN BETWEEN the existing 2 SATA drives, each of which has a bootable Linux installation on it. So I got to play fstab-doctor and menu.lst doctor for awhile, using a live CD. It's good to have this kind of "how-to" available at such times.

      Comment


        #4
        Re: HOWTO: Mount hard drive using live cd

        thanx for the info.however my kubuntu doesn't work too well but ubuntu
        works fine.i can't edit /etc/fstab,to add lines using VI(?).also,how do i get the 2 hard drives on the desktop.i do use sudo.thank you.

        Comment

        Working...
        X