LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to mount an external (or just copy the folders off it) on /temp partition (https://www.linuxquestions.org/questions/linux-software-2/how-to-mount-an-external-or-just-copy-the-folders-off-it-on-temp-partition-4175447913/)

Fada 01-30-2013 08:30 PM

How to mount an external (or just copy the folders off it) on /temp partition
 
Is it possible? I divided my hard drive in several partitions: /, /home, and /temp
Now I want to copy the folders off the external drive to the /temp partition. Or if it's possible to mount the external there.
I tried copying a couple of times before and it would end up copying the files over the existing hard drive, killing the OS. Had to reinstall. I think it happened because I had only 1 partition before and the external had no choice. Now if I start copying again, how do I make sure it goes to the place I want it to go. Not to overwrite my existing files... Any help? Do I make any sense at all?
Thank you for your time!

yancek 01-30-2013 08:52 PM

There is a system directory 'tmp'. Did you create a directory named /temp? And if so, where is it? The / of the filesystem? In the /mnt directory? Is it mounted? Posting the output of the following commands would give someone more information to work with:

fdisk -l(lower case Letter L in the command, run as root)
df -h

Fada 01-30-2013 10:12 PM

Quote:

Originally Posted by yancek (Post 4881035)
There is a system directory 'tmp'. Did you create a directory named /temp? And if so, where is it? The / of the filesystem? In the /mnt directory? Is it mounted? Posting the output of the following commands would give someone more information to work with:

fdisk -l(lower case Letter L in the command, run as root)
df -h

Hello Yancek,

Here is fdisk -l
fdisk -l

Code:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 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: 0x0001940b

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        3657    29366272  83  Linux
/dev/sda2            3657      31619  224609280  83  Linux
/dev/sda3          31619      38306    53710848  83  Linux
/dev/sda4          38306      38792    3906561    5  Extended
/dev/sda5          38306      38792    3906560  82  Linux swap / Solaris

and df -h

Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              28G  3.7G  23G  15% /
none                  1.8G  300K  1.8G  1% /dev
none                  1.9G  1.1M  1.9G  1% /dev/shm
none                  1.9G  192K  1.9G  1% /var/run
none                  1.9G    0  1.9G  0% /var/lock
none                  1.9G    0  1.9G  0% /lib/init/rw
/dev/sda3              51G  172K  48G  1% /tmp
/dev/sda2            211G  160M  200G  1% /home

I guess you would see the answers in the commands you requested. Thank you!

chrism01 01-31-2013 12:28 AM

You've got 3 partitions there:
1. /
2. /home
3. /tmp #This is NOT the same as '/temp' (note spelling)

If you created a dir called /temp, it would end up in the '/' partition, which would explain the problems you're having.
You might be able to use /tmp IF its big enough to get all the new files onto...

Fada 01-31-2013 12:48 AM

Quote:

Originally Posted by chrism01 (Post 4881117)
You've got 3 partitions there:
1. /
2. /home
3. /tmp #This is NOT the same as '/temp' (note spelling)

If you created a dir called /temp, it would end up in the '/' partition, which would explain the problems you're having.
You might be able to use /tmp IF its big enough to get all the new files onto...

Hi Chris,

Sorry for writing temp instead of tmp. The /tmp file is twice the size of the hard drive I want to copy. I created the /tmp partition especially for the purpose of either copying folders and files from the external or mounting the external on it. Now I am hoping for a help, because I am not sure I should try and follow the instructions from the sites. Even though they are posted by professionals or people with a lot of experience, they have a bit different OS or different situation, etc.
Would you please tell me how exactly I could use /tmp as a destination? I need the commands, the more details the better. Thanks a lot!

chrism01 01-31-2013 07:44 AM

Ok, but lets remember, the devil is in the details :)

What's the external disk; is a normal hard disk, usb, remote nfs mount...?
Also, what file system eg ext3, ext4, NTFS ...?

Fada 01-31-2013 11:12 AM

Chris, while getting the details about the external, I realized that I made a mistake making partitions.
Here are the details of external hard drive

Code:

External hard drive is in the enclosure. The type is Ext4 (version 1.0)
Capacity - 250 GB
It is USB (connected at 480.0  Mb/s)

The mistake is that /tmp I made the size of about 50 Gb, when it should be at least 250 to fit in the external drive. is there any way I can copy the external to the /home partition? Would I be able to access it after? Or if I mount it on /home? Or should I resize the partitions?
My goal is to copy the files (or to mount the external), then copy the important files to DVDs or memory sticks and then reinstall the OS. So, all that is going on on my laptop now is temporary. I am learning about partitions and other stuff. Have learned a lot in the last 2 weeks, but still feel like I know nothing.
Any help or advice will be highly !!! appreciated.

chrism01 01-31-2013 05:53 PM

Given your ultimate goal, just mount the external drive as usb and start DVD'ing :)
I see I forgot to ask what distro+version your OS is
Code:

cat /etc/*release*
uname -a

Usually on my Centos6.3, modern HW, just plugging the disk in should cause it to automatically mount, thx to udev.
Otherwise I'd do something like
Code:

# create temporary mnt pt
mkdir -p /mnt/usb

# check what the OS sees the disk as (lowercase L)
fdisk -l

# try default mnt ; assuming drive shows up as /dev/sdc
mount /dev/sdc1 /mnt/usb

# or try with FS type specified
mount -t ext4 /dev/sdc1 /mnt/usb

You should read up on those cmds so you understand what I'm doing. You may have to play around a bit to make it match your setup.

Fada 01-31-2013 07:16 PM

I tried mounting, didn't work. I have another thread about it. I think the problem could have been that I had only 1 partition on my disk.
I am going to try the codes you gave me and play around and see if I can get something.
Meanwhile, here are the results of the commands you gave me (why do I often type resluts instead of results lol and I am not even a man :)///

# cat /etc/*release*

Code:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Zorin OS 3.1"

root@fada-laptop:~# uname -a
Code:

Linux fada-laptop 2.6.32-34-generic #77-Ubuntu SMP Tue Sep 13 19:39:17 UTC 2011 x86_64 GNU/Linux

chrism01 01-31-2013 07:23 PM

Re typos; well, I've got the British Dictionary add-on for firefox, so it highlights my typos and and I can fix them with right click; a bit like spell check in eg Word.
Recommended :)

Fada 01-31-2013 07:40 PM

Quote:

Originally Posted by chrism01 (Post 4881789)
Re typos; well, I've got the British Dictionary add-on for firefox, so it highlights my typos and and I can fix them with right click; a bit like spell check in eg Word.
Recommended :)

Yes, I used to have it too :) I don't have anything on my laptop now as I don't want to install anything till I know I am not reinstalling it again. I haven't even done my mail program because I got tired of setting it up after every installation.
I am going to try to mount the external... Will be checking this thread from the Ipad if something goes wrong again. Please post whatever thoughts come to your mind. I am willing to try everything under the Moon :)
It shouldn't hurt the laptop if I reinstall the system so many times.

Fada 01-31-2013 09:21 PM

my f-disk -l

Code:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 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: 0x0001940b

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        3657    29366272  83  Linux
/dev/sda2            3657      31619  224609280  83  Linux
/dev/sda3          31619      38306    53710848  83  Linux
/dev/sda4          38306      38792    3906561    5  Extended
/dev/sda5          38306      38792    3906560  82  Linux swap / Solaris

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 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: 0x00091280

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1      29700  238557184  83  Linux
/dev/sdb2          29700      30402    5639169    5  Extended
/dev/sdb5          29700      30402    5639168  82  Linux swap / Solaris

I am a bit scared to try mounting, still reading. I am trying to figure out, or better say to understand, if I have /tmp and /home and I will try to mount it would it go on /tmp or /home? If it will go on /home would I be able to keep using the OS after the /home gets corrupted?
Last couple of times I had to reinstall the OS. Would it be different now when I have /home separated?
The most important question I have for now is: Can I specify which partition I want the external to mount on/to?

chrism01 02-01-2013 01:06 AM

Follow my post #8, but use sdb instead of sdc :)
Note you are confusing mount points and partitions.
As per my example, you create a mt pt (ie a dir eg /mnt/something) then mount the 'external' disk partition sdb1 at /mnt/something.
No need to mess with your real OS.
This is how I get photos off my phone; plug in usb and it appears as sdc (already have 2 HDDs).

Fada 02-01-2013 10:22 AM

Hi Chris,

Both commands give me the same result (very familiar)

Code:

wrong fs type, bad option, bad superblock on /dev/sdb,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so


Fada 02-03-2013 06:09 PM

I am back with the same question. I was not updating here because I managed to lock myself out of my laptop with the HDD password. It took me 2 days to solve the problem. Now i am back to square one as they say.
So far, I've tried to copy (with dd) external hard drive to a partition "/home" of the internal hard drive. It didn't work. Get the output/ input error.
May be I shood copy it to more specific location, like "/media/abbc3956-524b-476e-a064-61a04ac4e279" as it is where the /home is mounted at?
Or just try to mounit there? May be this way mounting will work. It didn't all the previous times.
Please give me something. Any advice? Any ideas? Any thoughts? Please don't ignore my problem. I am stuck here. Spend half a night trying to figure out what to do and reading articles and posts. I have a little child, so can't do it all day unfortunately.
Thank you!


All times are GMT -5. The time now is 07:47 AM.