[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.
I don't think so. It might change the drive from sdb to sda but not the partition number. You indicate that your external drive is formatted as ntfs but the information you posted shows this:
Is that your external drive? If so and it is a 1TB drive, you have a very small ext4 partition, a 992GB Extended partition with a 992GB swap partition!! It doesn't show any windows (ntfs) partitions! Where is your data? Is the data from a windows OS/filesystem or from Linux?
You need to click a partition in the main window to highlight it, then click on partition tab at the top to do anything, resize or whatever.
You don't need to create a partition table.
Are you now booted into your Ubuntu Desktop with the external drive attached? Do you have only one 1TB drive? The first thing I would do is delete that swap partition, then create a new 1GB partition and format it as ext3 (or ext4, whatever it is) since you only have 270MB of data to copy.
I'm a little confused about there not being any ntfs partitions, you said you had the entire drive formatted ntfs and there is no indication of that in your output??
What exactly do you have in your /home partition that you want to copy? Text files, images, ???
Clonezilla works fine for copying partition to partition or drive to drive but if you just have data files and only about 270MB, there is no reason you could not just use the cp command.
What exactly happened when you used Puppy to try to copy the files back to your Ubuntu drive from the external? When I did it, they copied fine but the permissions were messed up after being copied to an ntfs filesystem. I don't see any ntfs filesystem on your drive??
What I am trying to save is my scripts and my labs (ext3). I also have some e-mails I guess that I saved there(ntfs).
I have about 8.8 GB on my sdb1.( The External USB HD)
Maybe some are virtual Box files, vdi files, that I am not too worried about. But I have no way of knowning for sure what they are, until after I transfered them back to a machine with ext3 system.
I don't think so. It might change the drive from sdb to sda but not the partition number. You indicate that your external drive is formatted as ntfs but the information you posted shows this:
Is that your external drive? If so and it is a 1TB drive, you have a very small ext4 partition, a 992GB Extended partition with a 992GB swap partition!! It doesn't show any windows (ntfs) partitions! Where is your data? Is the data from a windows OS/filesystem or from Linux?
You need to click a partition in the main window to highlight it, then click on partition tab at the top to do anything, resize or whatever.
You don't need to create a partition table.
Are you now booted into your Ubuntu Desktop with the external drive attached? Do you have only one 1TB drive? The first thing I would do is delete that swap partition, then create a new 1GB partition and format it as ext3 (or ext4, whatever it is) since you only have 270MB of data to copy.
I'm a little confused about there not being any ntfs partitions, you said you had the entire drive formatted ntfs and there is no indication of that in your output??
What exactly do you have in your /home partition that you want to copy? Text files, images, ???
Clonezilla works fine for copying partition to partition or drive to drive but if you just have data files and only about 270MB, there is no reason you could not just use the cp command.
What exactly happened when you used Puppy to try to copy the files back to your Ubuntu drive from the external? When I did it, they copied fine but the permissions were messed up after being copied to an ntfs filesystem. I don't see any ntfs filesystem on your drive??
That's what I see in GParted GUI page, plus the color coding and the locks of course.
The major sub menu that I would need to resize or move partitions is greyed out. Move/Resize
You are posting conflicting information. You had earlier stated that your entire external drive was formatted as ntfs (windows). In your more recent posts, you show three partitions on your 1TB external drive. sda1 is ext4 format, 73..56MB in size. You also have and Extended partition (sda2) which contains only a swap partition (sda5) both of which are 992GB in size. That's OK for an Extended partition but, 2-4GB is more than enough for any swap partition.
Quote:
The major sub menu that I would need to resize or move partitions is greyed out
So in the main window of GParted, you are NOT able to click on sda5 to highlight it?
What happened to the folders/files you indicated earlier you had successfully used Puppy to copy to the External drive? You had 272MB in your /home partition and the last post indicates only 73.56MB ext4 on the external?
You are posting conflicting information. You had earlier stated that your entire external drive was formatted as ntfs (windows). In your more recent posts, you show three partitions on your 1TB external drive. sda1 is ext4 format, 73..56MB in size. You also have and Extended partition (sda2) which contains only a swap partition (sda5) both of which are 992GB in size. That's OK for an Extended partition but, 2-4GB is more than enough for any swap partition.
So in the main window of GParted, you are NOT able to click on sda5 to highlight it?
What happened to the folders/files you indicated earlier you had successfully used Puppy to copy to the External drive? You had 272MB in your /home partition and the last post indicates only 73.56MB ext4 on the external?
I am not posting conflicting info here. I just made a mistake with GiB instead of MiB. Evereything else is, what I have said from the beginning.
That's what puppy's GParted page is showing.
I always said this is what I have.
1) USB External Hard Drive : 1 TB it is NTFS .
I didn't format it. It was already formatted with NTFS when I bought it. Done by Seagate itself, and came bundled with FreeAgentGoNext backup software. Too bad I haven't used it so far.
2) Ubuntu desktop : 73.56 GiB not MiB in size.(ext3)
what you saw there above, is what puppy's GParted is showing. Now that I think, it is probably compressing my NTFS drive.(At least compressing the 8.8 GB which is data on it. Becasue most of it is free. 99%) sda2 & sda5 are 992 MiB not GiB
It is probably also converting ext3 to ext4. Since my original files were on ext3. I didn't have ext4. I am baffled by all these just like you guys are. I never knew about puppy until Repo said about it here on this thread. I mean how could you know, there are so many linux distros out there.
I corrected that above in my last post.
MiB & GiB is how GParted is showing them.
I am more comfortable with MB & GB.
I think you need to read my post more carefully.
I said in the GParted page, under the menu partitions, sub menu Move/Resize is greyed out, as are most other sub menus, where is our friend Repo from Belgium to say what to do with the useless greyed out sub menus?
I didn't say I can't highlight sda5.
a Linux partition, an Extended partition and a Linux swap partition. You said this drive which you indicate is your external was formatted as ntfs. There are no ntfs partitions there.
Quote:
I didn't say I can't highlight sda5.
I suggested you highlight first before trying to resize or perform any action. It needs a partition selected to work with for any option except create in which case you would need to select a drive (sda, sdb, etc.) Did you try this?
If you are doing this on your Ubuntu Desktop, does only one drive show? I expect the partition info above is your internal drive.
Going back over your posts, post #12 shows sda11 which you indicate later is your /home partition.
The fdisk output also shows sdb1 which does show as ntfs (your external drive)
In post 15, if you look at the output, you will see two entries for sda11. That's not really a problem but what it means is that there wasn't really any need to create a mount point as the partition was outmounted as a previous poster had suggested.
In post 27 I suggested that you would likely have problems copying files from a Linux to an ntfs partition and back which proved to be true. Permissions got messed up.
In post 57, I explained how to copy your /home partition (sda11) to the external with the disclaimer above.
I understood at that time that what you wanted to do was copy your user (mansour) files/folders from the /home partition to your external after changing directories to the /home partition.
Quote:
cd /mnt/sda11/home
cp -a -x mansour/* /mnt/sdb1
You indicated in your subsequent post that the files had copied to sdb1.
You later posted back that you were unable to copy them back to sda11 and in that post you indicate that it didn't work but don't indicate what command you used. You also refer in this post (60) to copying to sda1?? Is that a typo and you meant sda11? The command you should have used after changing directories to /mnt/sdb1:
Quote:
cd /mnt/sdb1
would be:
Quote:
cp -a -x mansour/* /mnt/sda11/home
You haven't explained what happened when you tried to copy back. I wouldn't bother doing this until you create a Linux partition on the external as permissions will just be messed up.
Have you had any luck with GParted? and do you see both sda (and its partitions) and sdb in the main GParted window?
Last edited by yancek; 10-04-2011 at 03:30 PM.
Reason: Add info
I'm not referring to the size of partitions but to the filesystem type. The information you posted shows:
a Linux partition, an Extended partition and a Linux swap partition. You said this drive which you indicate is your external was formatted as ntfs. There are no ntfs partitions there.
I suggested you highlight first before trying to resize or perform any action. It needs a partition selected to work with for any option except create in which case you would need to select a drive (sda, sdb, etc.) Did you try this?
If you are doing this on your Ubuntu Desktop, does only one drive show? I expect the partition info above is your internal drive.
Going back over your posts, post #12 shows sda11 which you indicate later is your /home partition.
The fdisk output also shows sdb1 which does show as ntfs (your external drive)
In post 15, if you look at the output, you will see two entries for sda11. That's not really a problem but what it means is that there wasn't really any need to create a mount point as the partition was outmounted as a previous poster had suggested.
In post 27 I suggested that you would likely have problems copying files from a Linux to an ntfs partition and back which proved to be true. Permissions got messed up.
In post 57, I explained how to copy your /home partition (sda11) to the external with the disclaimer above.
I understood at that time that what you wanted to do was copy your user (mansour) files/folders from the /home partition to your external after changing directories to the /home partition.
You indicated in your subsequent post that the files had copied to sdb1.
You later posted back that you were unable to copy them back to sda11 and in that post you indicate that it didn't work but don't indicate what command you used. You also refer in this post (60) to copying to sda1?? Is that a typo and you meant sda11? The command you should have used after changing directories to /mnt/sdb1:
would be:
You haven't explained what happened when you tried to copy back. I wouldn't bother doing this until you create a Linux partition on the external as permissions will just be messed up.
Have you had any luck with GParted? and do you see both sda (and its partitions) and sdb in the main GParted window?
Ok. Sorry my mistake. I am learning to use the GParted now.
I am now inside the sdb1 in GParted.
I managed to resize it to just a bit more than used space on my NTFS HD.
It looks like this now:
Code:
Partition file system Label Size Used unused
/dev/sdb1 ntfs FreeAgent Drive 8.79 GiB 8.74 GiB 53.09 MiB
unallocated 922.72 GiB
Code:
Partition file system Label Size Used unused Flag
/dev/sda1 (lock sign)ext4 73.56 GiB 6.37 GiB 67.19 MiB boot
/dev/sda2 (lock sign)extended 992. MiB
/dev/sda5 (lock sign)linux-swap 992. MiB
I also see the Move/Resize sub menus enabled now.
So what would I do now?
But when I open also second instance of GParted for the sda1, I see locks again next to all three partitions.
sda1 & sda2 & sda5. And sda1 is where I should be copying the files to(73.56 GiB).
The other two, one is swap, the other one is extended but is only 922 MiB. Is too small for my files. But as long as there is lock next to it, I doubt I can do anything with it.(I mean sda1 - the 73.56 GiB)
Any ideas here. Or how to use the Clonezilla here?
922 of unallocated space you can create a linux partition on it & not have a problem, it's not like you have to resize the drive. you have enogh space to clone the whole drive.
The information below is your sdb/external drive. It is the drive on which you need to create a Linux partition. You have an 8.79GB windows/ntfs partition. Leave it alone! In this window, left-click on the line unallocated to highlight it.
But when I open also second instance of GParted for the sda1
NO! Don't do that. There is absolutely no reason to do it! You need to leave sda alone. All you are doing here is creating a partition on your external to which you can copy the files from your home directory.
Once you have clicked on the unallocated line in the main window to highlight it, click on the Partition tab at the top. You should see a drop down menu. The first item should be New or Create New. Click on it. A new window should open. In that window, you should see New Size with a box to the right. Enter 1000 for 1000MB or 1GB. In Create as, use Primary partition. In Filesystem select ext3 or ext4. Click the Add tab. After doing that you should see in the main window New Partition, the filesystem type (ext3 or ext4) and the size. Check that everything is correct. There should be an Apply tab at the top. Click it and you may get another warning, do you really want to do this. Check it. If it's correct, click Apply. When you have done that, you should see in the main window /dev/sdb2, Filesystem type, Size, Used and Unused. It will probably show about 20MB used even though it is new. Don't worry about it.
You should then be able to copy using the Puppy CD in your notebook and the commands I posted earlier which you said worked with your Puppy CD. You will have to go through the mkdir and mount steps from previous posts because all that info disappears on reboot. I can't remember if you just wanted to copy the /home/mansour directory or the entire /home. If it's the entire /home directory, you will need to modify the commands to suit.
The information below is your sdb/external drive. It is the drive on which you need to create a Linux partition. You have an 8.79GB windows/ntfs partition. Leave it alone! In this window, left-click on the line unallocated to highlight it.
NO! Don't do that. There is absolutely no reason to do it! You need to leave sda alone. All you are doing here is creating a partition on your external to which you can copy the files from your home directory.
Once you have clicked on the unallocated line in the main window to highlight it, click on the Partition tab at the top. You should see a drop down menu. The first item should be New or Create New. Click on it. A new window should open. In that window, you should see New Size with a box to the right. Enter 1000 for 1000MB or 1GB. In Create as, use Primary partition. In Filesystem select ext3 or ext4. Click the Add tab. After doing that you should see in the main window New Partition, the filesystem type (ext3 or ext4) and the size. Check that everything is correct. There should be an Apply tab at the top. Click it and you may get another warning, do you really want to do this. Check it. If it's correct, click Apply. When you have done that, you should see in the main window /dev/sdb2, Filesystem type, Size, Used and Unused. It will probably show about 20MB used even though it is new. Don't worry about it.
You should then be able to copy using the Puppy CD in your notebook and the commands I posted earlier which you said worked with your Puppy CD. You will have to go through the mkdir and mount steps from previous posts because all that info disappears on reboot. I can't remember if you just wanted to copy the /home/mansour directory or the entire /home. If it's the entire /home directory, you will need to modify the commands to suit.
Good Luck. I'm going to sleep.
Ok. So I choose sdb1 and open the GParted screen again. I highlight the unallocated space.
Click on Partition menu at the top. And click on New.
For which? The free space should have a number in it already equivalent to the sdb1 partition size.
New Size in MB, I suggested in my last post 1000MB. You need a partition larger than the one you want to copy here which from your earlier posts showed 272MB.
Free space following should also already have a number in it. If it doesn't, don't worry about it. You are just doing this temporarily and will delete it all later.
Create as: Primary as I said in my last post.
Filesystem: you said your Ubuntu was ext3 so put that.
Label: nothing, you don't need anything here.
I don't have an align to option so I imagine you have a different version?
When you have done the above, you should have an Apply tab somewhere to click and you should also get a warning asking if you are sure so make sure you have the correct filesystem, partition, the size is greater than the partition (sda11 on the notebook) you want to copy there.
Are you using GParted from the Puppy Lupu CD?
If you are unsure about this, there are numerous tutorials on the use of GParted online, a link to one below which has images of each step:
For which? The free space should have a number in it already equivalent to the sdb1 partition size.
New Size in MB, I suggested in my last post 1000MB. You need a partition larger than the one you want to copy here which from your earlier posts showed 272MB.
Free space following should also already have a number in it. If it doesn't, don't worry about it. You are just doing this temporarily and will delete it all later.
Create as: Primary as I said in my last post.
Filesystem: you said your Ubuntu was ext3 so put that.
Label: nothing, you don't need anything here.
I don't have an align to option so I imagine you have a different version?
When you have done the above, you should have an Apply tab somewhere to click and you should also get a warning asking if you are sure so make sure you have the correct filesystem, partition, the size is greater than the partition (sda11 on the notebook) you want to copy there.
Are you using GParted from the Puppy Lupu CD?
If you are unsure about this, there are numerous tutorials on the use of GParted online, a link to one below which has images of each step:
Yes, I am using GParted from within puppy live CD on my ubuntu desktop machine.
So I put live puppy CD into ubuntu desktop machine and boot into it.
And then opened the GParted screen there.
OK done. So now I have also an sdb2.
Pmount Puppy Drive Mounter
Do Not Remove Mounted Media
floppy|drive|optical|usbdrv
sdb1 ntfs 8.8 G 82 M free
sdb2 ext3 8.8G 8.1 G free
Of course, when choosing drive which is sda1, unmount Button is greyed out/disabled since it is already busy and can not be unmounted.
So how would I copy from one to the other now. What are the commnads I shoud use?
Is this the command I should use in the puppy console? (v for the verbose so that I know what is happening and R for recursive, I don't know what is -a for )
# cp -avR /mnt/sdb1/ /mnt/sdb2/
After doing the above command, I do:
# ls /mnt/sdb2/
But I only see two of my files. all the rest are missing.
Just like when I copied it directly to the ubuntu desktop /home directory.
My wild guess is that, this problem has to do with permissions and ownership of dierctories in two different partitions. Anybody knows how to fix that problem?
Unfortunately I can't copy and paste from within puppy console to the linuxquestions.org Forum. Since Puppy's Internet browser, would not even show the Edit button at the bottom of each post. It is obviously not as sophisticated as the IE or FireFox. or I don't know how to enable it. Also I am only using live CD, so maybe that's why I don't get all the browser capabilities.
For which? The free space should have a number in it already equivalent to the sdb1 partition size.
New Size in MB, I suggested in my last post 1000MB. You need a partition larger than the one you want to copy here which from your earlier posts showed 272MB.
Free space following should also already have a number in it. If it doesn't, don't worry about it. You are just doing this temporarily and will delete it all later.
Create as: Primary as I said in my last post.
Filesystem: you said your Ubuntu was ext3 so put that.
Label: nothing, you don't need anything here.
I don't have an align to option so I imagine you have a different version?
When you have done the above, you should have an Apply tab somewhere to click and you should also get a warning asking if you are sure so make sure you have the correct filesystem, partition, the size is greater than the partition (sda11 on the notebook) you want to copy there.
Are you using GParted from the Puppy Lupu CD?
If you are unsure about this, there are numerous tutorials on the use of GParted online, a link to one below which has images of each step:
I thought I should share my findings with the Forum members in Newbie section here.
I finally got to the bottom of this problem. I re-built my ubuntu 10.10 notebook and was able to transfer my personal files to it without a hitch.
OK. I didn't really need to use Puppy as one member suggested, nor did I need to use Clonezilla to clone anything as another member suggested. cp command was all I needed, really.
I only needed to scape the space, in "FreeAgent Drive" for the cp command to work properly, as posted above, and I didn't know that simple fact myself. And unfortunately no one in the Forum paid attention to that simple fact to give me the solution, that puzzeled us all, for so many days on this Forum.
Also no need to mount the USB External Hard Drive on the ubuntu desktop 10.04 or ubuntu 10.10 notebook, or any other machine, as I had thought I should do. It is mounted authomatically itself.
I nevertheless thank you all who supported me by posting your solutions here, on this thead. I asked my former boss to help me, and he was able to do it in one evening, in a matter of 3 hours, only by reading my terminal results and exchanging e-mails with me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.