LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 01-30-2013, 08:30 PM   #1
Fada
Member
 
Registered: Jan 2013
Posts: 43

Rep: Reputation: Disabled
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!
 
Old 01-30-2013, 08:52 PM   #2
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,139

Rep: Reputation: 622Reputation: 622Reputation: 622Reputation: 622Reputation: 622Reputation: 622
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
 
Old 01-30-2013, 10:12 PM   #3
Fada
Member
 
Registered: Jan 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
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!
 
Old 01-31-2013, 12:28 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,086

Rep: Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995
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...
 
Old 01-31-2013, 12:48 AM   #5
Fada
Member
 
Registered: Jan 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
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!
 
Old 01-31-2013, 07:44 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,086

Rep: Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995
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 ...?
 
Old 01-31-2013, 11:12 AM   #7
Fada
Member
 
Registered: Jan 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
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.
 
Old 01-31-2013, 05:53 PM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,086

Rep: Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995
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.
 
Old 01-31-2013, 07:16 PM   #9
Fada
Member
 
Registered: Jan 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
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
 
Old 01-31-2013, 07:23 PM   #10
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,086

Rep: Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995
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
 
Old 01-31-2013, 07:40 PM   #11
Fada
Member
 
Registered: Jan 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
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.
 
Old 01-31-2013, 09:21 PM   #12
Fada
Member
 
Registered: Jan 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
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?
 
Old 02-01-2013, 01:06 AM   #13
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,086

Rep: Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995Reputation: 1995
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).
 
Old 02-01-2013, 10:22 AM   #14
Fada
Member
 
Registered: Jan 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
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
 
Old 02-03-2013, 06:09 PM   #15
Fada
Member
 
Registered: Jan 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mount storage partition folders to home folders skykooler Linux - Newbie 4 10-07-2010 10:56 PM
how to copy a partition to a directory, then mount it i_heart_pandas Linux - General 2 09-04-2009 08:22 PM
Mount external hard drive's folder as partition visible in df WojtekO Linux - Newbie 7 03-11-2009 09:33 PM
Can I mount two folders to one partition? gckaibab Linux - Newbie 11 03-20-2006 10:35 PM
Cant copy files to a fat partition i mount as RW? FocusedWolf Linux - Hardware 6 03-18-2004 04:43 PM


All times are GMT -5. The time now is 09:02 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration