[SOLVED] How do I mount External Hard Drive and what command to backup Home Folder to it ?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I mount External Hard Drive and what command to backup Home Folder to it ?
Hello:
On ubuntu 10.10 notebook edition, that won't boot due to /sbin/init being damaged, how would I mount the External Hard Drive and then what command would I use to backup my Home Folder to External Hard Drive , using live CD?
I am hoping to salvage my Home Folder and then do a Re-install of my ubuntu 10.10 notebook edition.
Using Live CD when I go to my home folder, I can see all the partitions on the old system and their size, but how would I back up the Home Folder to the external HD?
mansour
Last edited by mansour; 09-30-2011 at 11:32 AM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
If you want to do things graphically, you can open nautilus in the home folder of the mounted partition:
Code:
$ cd /media/mypartition/home/yourusername
$ nautilus .
Hope these help.
Ok, I performed all the above commnads in the terminal.
But it didn't work. I couldn't copy to mypartition directroy. I suspect has to do with the fact that my External Usb Drive is an NTFS file system?
But it didn't work. I couldn't copy to mypartition directroy. I suspect has to do with the fact that my External Usb Drive is an NTFS file system?
Probably not but it isn't a good idea to copy directories/files from a Linux filesystem to a windows filesystem. I wouldn't expect anything but trouble from it.
I would suggest that if you are doing this from an Ubuntu CD, you run the sudo fdisk -l(lower case Letter L in the command) and post that drive/partition information here. If your external is auto-mounted it probably is in the /media directory with a UUID number. You will need to create a mount point for your external partition if you are going to use a terminal to copy to it. Post the fdisk output.
Distribution: Testing Ubuntu/XUbuntu/KUbuntu 12.04, Mint 13 (all flavors)
Posts: 56
Rep:
Try doing the following:
- Boot your laptop with the LiveCD
- Once you are at the desktop, connect your external hard drive to your laptop
- Start a Terminal window
In the following order:
- Type lsusb
- Type su (this should get you root access)
- Type fdisk -l
- Type mount
- Type cat /etc/fstab
Post the results of those commands.
Update: I tried sudo on my fresh Slackware v13.37 install when logged in as a regular user (non-root and non-super user) and it gave me an error message stating that my regular user account is not in the sudoers file. However, su just asks for the root password if I boot into Slackware. If I boot a Knoppix v6.7.1 LiveCD su doesn't require a password for root. I suspect the Ubuntu LiveCD may not require a password for su. If sudo doesn't work try su.
OP is using ubuntu and for root access he should be using 'sudo' to start his command lines. With the live cd he will not be asked for a password.
yancek is right and all we need is the uuid and the following should solve all.
Quote:
I would suggest that if you are doing this from an Ubuntu CD, you run the sudo fdisk -l(lower case Letter L in the command) and post that drive/partition information here
Last edited by Larry Webb; 09-30-2011 at 08:16 PM.
ubuntu@ubuntu:~$ cp -R /media/mypartition /dev/sdb1/mypartition
cp: accessing `/dev/sdb1/mypartition': Not a directory
ubuntu@ubuntu:~$ cp -R /media/mypartition /dev/sdb1/
cp: accessing `/dev/sdb1/': Not a directory
ubuntu@ubuntu:~$ ^C
ubuntu@ubuntu:~$
I am soooo.... lost.
mansour
Your commands are wrong. Something like this would be better:
mkdir /mnt/extdrive
mount /dev/sdb1 /mnt/extdrive
# check that /dev/sdb1 is mounted
mount
mkdir /mnt/tmphome
# you need to get the right partition to mount the home directories
mount /dev/sda???? /mnt/tmphome
# check that tmphome is mounted
mount
cp -a /mnt/tmphome /mnt/extdrive
This is for if /home is on its own partition. If it isn't, your cp command should be more like this:
This is for if /home is on its own partition. If it isn't, your cp command should be more like this:
cp -a /mnt/tmphome/home /mnt/extdrive
And your 'cp' command won't get all the hidden files and directories either. I recommend the OP use 'tar' in order to backup the contents of the home directory.
And your 'cp' command won't get all the hidden files and directories either. I recommend the OP use 'tar' in order to backup the contents of the home directory.
Sure use tar if you want. But cp -a does copy hidden files and directories. Test it if you don't believe it.
Probably not but it isn't a good idea to copy directories/files from a Linux filesystem to a windows filesystem. I wouldn't expect anything but trouble from it.
I would suggest that if you are doing this from an Ubuntu CD, you run the sudo fdisk -l(lower case Letter L in the command) and post that drive/partition information here. If your external is auto-mounted it probably is in the /media directory with a UUID number. You will need to create a mount point for your external partition if you are going to use a terminal to copy to it. Post the fdisk output.
Hi:
So this is the output of that command:
Code:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 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: 0x000a129c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 16 123904 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 16 4864 38943745 5 Extended
/dev/sda5 16 989 7811072 83 Linux
/dev/sda6 989 1475 3905536 83 Linux
/dev/sda7 1475 1961 3905536 83 Linux
/dev/sda8 1961 2448 3905536 83 Linux
/dev/sda9 2448 3055 4881408 83 Linux
/dev/sda10 3056 3239 1475584 82 Linux swap / Solaris
/dev/sda11 3239 4864 13052928 83 Linux
Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes
255 heads, 63 sectors/track, 121601 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: 0xa4b57300
Device Boot Start End Blocks Id System
/dev/sdb1 1 121601 976760000+ 7 HPFS/NTFS
ubuntu@ubuntu:~$
Try doing the following:
- Boot your laptop with the LiveCD
- Once you are at the desktop, connect your external hard drive to your laptop
- Start a Terminal window
In the following order:
- Type lsusb
- Type su (this should get you root access)
- Type fdisk -l
- Type mount
- Type cat /etc/fstab
Post the results of those commands.
Update: I tried sudo on my fresh Slackware v13.37 install when logged in as a regular user (non-root and non-super user) and it gave me an error message stating that my regular user account is not in the sudoers file. However, su just asks for the root password if I boot into Slackware. If I boot a Knoppix v6.7.1 LiveCD su doesn't require a password for root. I suspect the Ubuntu LiveCD may not require a password for su. If sudo doesn't work try su.
Code:
ubuntu@ubuntu:~$ lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 0bc2:2120 Seagate RSS LLC
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ubuntu@ubuntu:~$ su
Password:
su: Authentication failure
ubuntu@ubuntu:~$ sudo -s
root@ubuntu:~# fdisk -l
Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 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: 0x000a129c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 16 123904 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 16 4864 38943745 5 Extended
/dev/sda5 16 989 7811072 83 Linux
/dev/sda6 989 1475 3905536 83 Linux
/dev/sda7 1475 1961 3905536 83 Linux
/dev/sda8 1961 2448 3905536 83 Linux
/dev/sda9 2448 3055 4881408 83 Linux
/dev/sda10 3056 3239 1475584 82 Linux swap / Solaris
/dev/sda11 3239 4864 13052928 83 Linux
Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes
255 heads, 63 sectors/track, 121601 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: 0xa4b57300
Device Boot Start End Blocks Id System
/dev/sdb1 1 121601 976760000+ 7 HPFS/NTFS
root@ubuntu:~# mount
aufs on / type aufs (rw)
none on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
/dev/sr0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /tmp 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)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
root@ubuntu:~# cat /etc/fstab
aufs / aufs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sda10 swap swap defaults 0 0
root@ubuntu:~#
The problem now is, which of the seven Linux partitions contains your home directory? You can eliminate sda1 as it is too small to be anything but a boot partition. sda2 is your Extended partition which contains no data and sda10 is swap. Do you have a separate /home partition or is it in your / partition? Why all these partitions if you only have Ubuntu? or do you?
The /etc/fstab file you posted is from the Live Cd and doesn't give any useful information.
Do you know where your /home directory is? on a separate partition? the / partition? do you know which partition that might be? If not you will probably have to try creating a mount point for each, mount each partition until you find your /home directory.
Repeat this process for each partition until you find it, partitions 5 - 11 (excepting 10 - swap) unless you know which partition it is??
sudo mkdir /mnt/sda5
sudo mount -t ext4 /dev/sda5 /mnt/sda5
After doing the above, you can navigate to the /mnt/sda5 partition to see if your /home is there: ls /mnt/sda5
You could also open nautilus file manager, sudo nautilus.
The problem now is, which of the seven Linux partitions contains your home directory? You can eliminate sda1 as it is too small to be anything but a boot partition. sda2 is your Extended partition which contains no data and sda10 is swap. Do you have a separate /home partition or is it in your / partition? Why all these partitions if you only have Ubuntu? or do you?
The /etc/fstab file you posted is from the Live Cd and doesn't give any useful information.
Do you know where your /home directory is? on a separate partition? the / partition? do you know which partition that might be? If not you will probably have to try creating a mount point for each, mount each partition until you find your /home directory.
Repeat this process for each partition until you find it, partitions 5 - 11 (excepting 10 - swap) unless you know which partition it is??
sudo mkdir /mnt/sda5
sudo mount -t ext4 /dev/sda5 /mnt/sda5
After doing the above, you can navigate to the /mnt/sda5 partition to see if your /home is there: ls /mnt/sda5
You could also open nautilus file manager, sudo nautilus.
This was our first school assignment, to create so many partitions manually, so to learn how manual partitioning works in Linux. I have two other Linux machine as part of a small network, which I let Linux do the partitioning for me. It was very simple. One is Ubuntu server 10.04 , the other is ubuntu 10.04 desktop.
So my /Home partition is the one which is 13 GB in size. (/dev/sda11 )
(It includes /root and /mansour )
When I go to Places ==> Home ==> I see all the partitions in the left pane. The 13 GB partition is /Home.
I can mount them all by right clicking on them and then choosing mount from the menu.
/dev/sdb1 is my USB Hard Drive.( 1 TB and is NTFS)
OK, I see a file was transfered to my USB HD called FreeAgentGoNext.ico
That's the name of my HD backup software.
I safely removed it from my notebook and put it on the ubuntu 10.04 desktop machine.
How would I be able to read them there though?
I mean FreeAgentGoNext.ico, what would I do to transfer this to the /home folder of ubuntu desktop machine?
Please help here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.