LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 10-20-2007, 10:48 AM   #1
Spearhead40
Member
 
Registered: Aug 2006
Location: Baltimore, MD
Distribution: Fedora 20
Posts: 51

Rep: Reputation: 15
Unhappy How to view/mount separate disk -- move /home to second disk


I have two separate disk on my system. The goal is to have my /home directory on one disk and everything else on the existing disk. I believe I have copied my existing /home directory onto second disk, however I can't "see" it anywhere to verify what I think is there....really is.

Here is a my fstab and mtab

/etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=7f8817ee-08e9-454c-b82f-4102d8f53e0a / ext3 defaults,errors=remount-ro 0 1
# /dev/sda5
UUID=791f399a-4b89-4587-aef9-a4dc64c5632b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec 0 0
/dev/sdb1 /home ext3 defaults, errors=remount=rw 0 1

/etc/mtab
/dev/sda1 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
/sys /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
udev /dev tmpfs rw,mode=0755 0 0
devshm /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
lrm /lib/modules/2.6.22-14-generic/volatile tmpfs rw 0 0
securityfs /sys/kernel/security securityfs rw 0 0


Can I use Dolphin to view what is on the sdb1 disk? If so how?

What in either fstab or mtab (maybe both?) needs to be changed so that the /home directory on the sdb disk is one that is always used?
 
Old 10-20-2007, 06:00 PM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
First of all, a question: the line in fstab which is supposed to mount your root filesystem from sda1...
Quote:
# /dev/sda1
UUID=7f8817ee-08e9-454c-b82f-4102d8f53e0a / ext3 defaults,errors=remount-ro 0 1
...is commented out. How is it possible that your root is actually mounted (mtab)...
Quote:
/dev/sda1 / ext3 rw,errors=remount-ro 0 0
?
Then, if the line...
Quote:
/dev/sdb1 /home ext3 defaults, errors=remount=rw 0 1
...really means that your "/home" is on sdb1, it should have a "2" and not a "1" at the very end. Only the root filesystem is supposed to have a "1" - have a look at "man fstab".
Third, what happens if you create any kind of directory and manually mount the partition (if sdb1 is really the place were you have your /home files) manually with "mount -v /dev/sdb1 /yourdirectory"? Do you see the files you're looking for?
Before doing the last step, do you see by executing "df -h" that /dev/sdb1 is mounted on /home?
 
Old 10-20-2007, 06:07 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
UUID is a valid alternative for the device specification - as is LABEL. The Ubuntu devs went with UUID to avoid issues with the libata change in 2.6.19 changing /dev/hd? to /dev/sd?

@Spearhead40, - as suggested try "df -h"; also "sudo fdisk -l",and post the results here.

Last edited by syg00; 10-20-2007 at 06:12 PM. Reason: Arrhhh !!! - skipped mtab.
 
Old 10-21-2007, 06:44 AM   #4
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Ah, sorry, now I got it - I thought there was no newline after "/dev/sda1"
 
Old 10-26-2007, 02:55 PM   #5
Spearhead40
Member
 
Registered: Aug 2006
Location: Baltimore, MD
Distribution: Fedora 20
Posts: 51

Original Poster
Rep: Reputation: 15
syg00 -- as you requested here is the results of df -h and fdisk -l:

Is it necessary to mount the disk to see what may or may not be on sdb2?


jon@jon-desktop:/$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 53G 3.6G 47G 8% /
varrun 633M 84K 633M 1% /var/run
varlock 633M 0 633M 0% /var/lock
udev 633M 80K 633M 1% /dev
devshm 633M 0 633M 0% /dev/shm
lrm 633M 34M 599M 6% /lib/modules/2.6.22-14-generic/volatile



jon@jon-desktop:/$ sudo fdisk -l
[sudo] password for jon:

Disk /dev/sda: 60.0 GB, 60040544256 bytes
255 heads, 63 sectors/track, 7299 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4e434e42

Device Boot Start End Blocks Id System
/dev/sda1 * 1 6996 56195338+ 83 Linux
/dev/sda2 6997 7299 2433847+ 5 Extended
/dev/sda5 6997 7299 2433816 82 Linux swap / Solaris

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b3638

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 19457 156183930 8e Linux LVM
jon@jon-desktop:/$

Last edited by Spearhead40; 10-26-2007 at 02:58 PM. Reason: add response text
 
Old 10-26-2007, 03:03 PM   #6
Spearhead40
Member
 
Registered: Aug 2006
Location: Baltimore, MD
Distribution: Fedora 20
Posts: 51

Original Poster
Rep: Reputation: 15
Pearseattle was right, I had originally had sdb2 in my fstab. When things didn't work out I changed it to sdb1. Since Pearlseattle pointed out the error, I have changed it back to sdb2.

fstab now reads as follows:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=7f8817ee-08e9-454c-b82f-4102d8f53e0a / ext3 defaults,errors=remount-ro 0 1
# /dev/sda5
UUID=791f399a-4b89-4587-aef9-a4dc64c5632b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec 0 0
/dev/sdb2 /home ext3 defaults, errors=remount=rw 0 1
 
Old 10-26-2007, 06:55 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Yes you do have to mount to see the data.
Why did you choose to use LVM ??? - you need to mount the LV, not the physical device. I would expect all the Ubuntu derivatives to load the required support at boot, but I'm not a LVM user.
 
Old 10-27-2007, 07:34 AM   #8
Spearhead40
Member
 
Registered: Aug 2006
Location: Baltimore, MD
Distribution: Fedora 20
Posts: 51

Original Poster
Rep: Reputation: 15
Installed sdb months and months ago, don't remember making a conscious decision to make the drive LVM (?) or not. If fact I had Kunbutu 6.06 on my system at the time. If having the two drive be different is problematic, can a change the LVM drive to extended (?) without losing the data on it? Or does it even matter?

I'll try to mount it, see what --if anything -- is on it. There should be a good deal of music on it that I would rather not lose if it can be helped.
 
Old 10-27-2007, 07:33 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Try a "pvscan" - it'll tell you if LVM is installed.
Drop in to tldp.org for the LVM how-to; it'll tellyou how to get the LV(s) mounted so you can see if the data is recoverable.
 
Old 10-29-2007, 04:52 PM   #10
Spearhead40
Member
 
Registered: Aug 2006
Location: Baltimore, MD
Distribution: Fedora 20
Posts: 51

Original Poster
Rep: Reputation: 15
I would like to reformat the LVM disk so that is it the same as the "normal" one. Is there an easy way to do that? Short of making it the primary disk then loading linux on it?
 
Old 11-02-2007, 05:51 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
You do realize you're going to lose any data on it - permanently ???.
Just delete the partition and create a new (Linux - type x'83') partition and do a mkfs on it. You *could* just mkfs straight over the top of it as it is, but that'll just lead to confusion later.
I use [c]fdisk and mkfs from a terminal, but if you prefer a GUI something like gparted should do it all for you I'd think.

Make a mountpoint (in need), and add it to fstab. Done.
 
Old 11-03-2007, 12:31 PM   #12
Spearhead40
Member
 
Registered: Aug 2006
Location: Baltimore, MD
Distribution: Fedora 20
Posts: 51

Original Poster
Rep: Reputation: 15
syg00 -- Yes, I realize the data will be lost. It's not a big deal... nothing critical was on there -- just possibly some music.

I reformatted the disk so it is now set up like so:

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 19214 154336423+ 83 Linux
/dev/sdb2 19215 19457 1951897+ 5 Extended
/dev/sdb5 19215 19457 1951866 83 Linux

The only difference I see between sda and sdb is the last partition. sda5 is designated "Linux swap/Solaris"

sdb5 is just "Linux" will that cause me problems?

Disk identifier is 0x00000000. Is that a problem?

Last edited by Spearhead40; 11-03-2007 at 12:38 PM. Reason: grammar; additional question
 
Old 11-03-2007, 03:37 PM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Type Linux (x83) is used for all data partitions - ext2/3, reiser, jfs whatever.
Swap partitions are the exception - type x82; so no, there's no problem there.

Partition layout is always open to debate. There is no need to have sdb5 as a logical - no harm either. That layout (from sda) is typical of the Ubuntu installer - in your case you could have just one (or two) primary partitions (on sdb) as you have allocated the entire disk.

As for the id, I never bothered with it. It looks like the id bytes M$oft disk management puts in the MBR. Won't matter in your case, and if you ever format a NTFS partition (under Windoze) I think it gets set if needed.
 
  


Reply

Tags
directory, home



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu and XP on 2 separate disk? kage_wing Ubuntu 9 07-13-2007 06:33 PM
How to install Windows in a separate Hard Disk? arindom Linux - Hardware 14 03-29-2007 09:02 AM
Migrate Directory to Separate Disk Partition Neapolitan Red Hat 1 01-18-2006 01:51 PM
Install Red Hat linux on separate disk Micik Linux - Newbie 4 12-06-2004 09:58 AM
XP on a separate disk and GRUB config greg108 Linux - Newbie 3 08-10-2004 11:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration