How do I install on partitions on 2 different disks?

Questions about Grub, the liveCD and the installer
Forum rules
Before you post please read this

How do I install on partitions on 2 different disks?

Postby idc on Thu May 17, 2012 4:06 pm

Hi,
I'm looking for advice from more experienced linux users on how to achieve the following : I want to install LMDE xfce 12.04 on my old eepc 701 as a first computer for my 8 year old son, who'd like to try programming.

The first problem
The 701's 4GB ssd is too small to hold the entire system; however, with an sdhc card in the internal card reader it should be possible to put /usr (the biggest space hog by far) and /home on partitions on the sdhc, while leaving root on the ssd.

The second problem
Unfortunately, the installer lacks an option of splitting the system over partitions on two different disks.
So how can I do this?

I've found instructions for moving /home and /usr onto a different disk/partition from root: viewtopic.php?f=189&t=87320&p=577998#p577998

Unfortunately, I haven't space to install onto the ssd prior to moving partitions. I can't believe this is game over; is there another strategy I can try? I assume installing onto the sdhc or a usb stick and then moving root onto the ssd (while leaving /usr and /home on the sdhc?) would be ... er ... involved?

Thanks in advance for your thoughts and advice.
Ian
idc
Level 1
Level 1
 
Posts: 18
Joined: Sat Dec 10, 2011 11:11 am

Linux Mint is funded by ads and donations.
 

Re: How do I install on partitions on 2 different disks?

Postby mintybits on Thu May 17, 2012 5:38 pm

Have you got a device you can install Mint to temporarily that you can attach to the 701?

If so, you can install it all to this device and then copy it in parts to the SSD and memory card, then make a few adjustments to fstab and grub and it should work. :)

The steps would be:
1. Attach the device.
2. Boot a Mint CD and install to the device.
3. Still in CD, use gparted to make the partitions you want on the SSD and card; use ext4
4. Mount the device root and the new partitions
5. Use rsync to copy from the device to the appropriate partitions
6. On the new root, edit fstab to set up the mounts and set the right UUIDs
7. Chroot into the new root and run 'update initramfs -u' and 'dpkg-reconfigure grub-pc'
8. Reboot off the SSD.

To determine the new UUIDs run 'sudo blkid'
To copy from one directory to another use 'sudo rsync -vax source/ target/' (the trailing / is important)

For example, suppose the SSD is /dev/sda, the memory card is /dev/sdb and the temporary device with Mint installed is /dev/sdf
Running off CD,

sudo mkdir /tmp/dev-root
sudo mount /dev/sdf1 /tmp/dev-root
sudo mkdir /tmp/ssd-root
sudo mount /dev/sda1 /tmp/ssd-root
sudo rsync -vax --exclude=/home --exclude=/usr /tmp/dev-root/ /tmp/ssd-root/
sudo umount /tmp/ssd-root

sudo mkdir /tmp/card-usr
sudo mkdir /tmp/card-home
sudo mount /dev/sdb1 /tmp/card-usr
sudo mount /dev/sdb2 /tmp/card-home
sudo rsync -vax /tmp/dev-root/usr/ /tmp/card-usr/
sudo rsync -vax /tmp/dev-root/home/ /tmp/card-home/
sudo umount /tmp/dev-root /tmp/card-usr /tmp/card-home

Then chroot into root on the SSD (see: https://help.ubuntu.com/community/Grub2 ... ing#ChRoot)
Run blkid to find the UUIDs for sda1, sdb1, sdb2 and your swap partition (sdb3?) and make/change entries in /etc/fstab to mount them.
Then run 'update-initramfs -u' and 'dpkg-reconfigure grub-pc' and choose the MBR of the SSD for grub, eg: /dev/sda.
exit from chroot and reboot.

Hope that helps. :)
mintybits
Level 5
Level 5
 
Posts: 836
Joined: Fri Jan 27, 2012 5:09 pm

Re: How do I install on partitions on 2 different disks?

Postby idc on Thu May 17, 2012 8:06 pm

Mintybits,
Thank you very much indeed for taking the time to help! That looks very much like what I'm after. You've put things in a wonderfully clear fashion and I think I should be able to follow those instructions (learning as I go).

It may take me a day or two to get to this now as I've exceeded my allotted fiddling with computers time. But I'm very grateful to you for this--and I expect a small boy will be pleased too!

Thanks again.
Ian
idc
Level 1
Level 1
 
Posts: 18
Joined: Sat Dec 10, 2011 11:11 am

Re: How do I install on partitions on 2 different disks?

Postby idc on Fri May 18, 2012 9:53 am

idc wrote:It may take me a day or two to get to this now as I've exceeded my allotted fiddling with computers time.

Who am I kidding? I've spent the morning copying things across.
Copying root to the ssd went fine. However I am concerned at the number of errors rsync threw up during parts of copying across to the /usr sdhc card. Some folders copied across fine. Others threw up errors like:
'rsync: recv_generator: mkdir "/tmp/car-usr/src/ndiswrapper-1.57" failed: Invalid argument (22)
*** Skipping any contents from this failed directory ***'

or (and I didn't manage to copy all this down before it scrolled off the scree):
'rsync: symlink ... failed: Invalid Argument (22)'

Am I right to be concerned about these? I am a little suspicious of the sdhc card I've used here. (I was having problems with a superblock until I reformatted it; I've bitten the bullet and ordered a new higher capacity sdhc card, which should get here eventually.)

Out of interest would this method of copying the /usr folder across offer any advantage over rsync? Or does rsync use the same underlying method ($find . -depth -print0 | cpio --null --sparse -pvd)?

Thanks very much for your help, mintybits. It is good to learn from you.
All the best,
Ian
idc
Level 1
Level 1
 
Posts: 18
Joined: Sat Dec 10, 2011 11:11 am

Re: How do I install on partitions on 2 different disks?

Postby mintybits on Fri May 18, 2012 11:36 am

idc wrote:Who am I kidding? I've spent the morning copying things across.

:lol:
Copying root to the ssd went fine. However I am concerned at the number of errors rsync threw up during parts of copying across to the /usr sdhc card. Some folders copied across fine. Others threw up errors like:
'rsync: recv_generator: mkdir "/tmp/car-usr/src/ndiswrapper-1.57" failed: Invalid argument (22)
*** Skipping any contents from this failed directory ***'

or (and I didn't manage to copy all this down before it scrolled off the scree):
'rsync: symlink ... failed: Invalid Argument (22)'

Am I right to be concerned about these? I am a little suspicious of the sdhc card I've used here. (I was having problems with a superblock until I reformatted it; I've bitten the bullet and ordered a new higher capacity sdhc card, which should get here eventually.)


You should not have any rsync errors. Something is wrong. It may not be your card.
If you run rsync again and add '--log-file temp' then it should make a log file called temp. If you look in there for error messages and post them here?
It may be an issue with symbolic links between / and /usr.
I'll try to replicate what you are doing in VirtualBox and see.
Out of interest would this method of copying the /usr folder across offer any advantage over rsync? Or does rsync use the same underlying method ($find . -depth -print0 | cpio --null --sparse -pvd)?

It depends what the problem is. If it is links then I don't think it will help. I am not familiar with cpio, tho.
mintybits
Level 5
Level 5
 
Posts: 836
Joined: Fri Jan 27, 2012 5:09 pm

Re: How do I install on partitions on 2 different disks?

Postby mintybits on Fri May 18, 2012 12:15 pm

I just replicated what you are doing using a mint Mint 12 installation. Worked fine. rsync had no problems at all. So I suspect it is your card.

I did notice an error in my instructions tho, :oops:
After you have copied /, usr and home to their respective partitions, you need to unmount them.
Then before the chroot,
mount the ssd partition at /mnt: sudo mount /dev/sda1 /mnt
make a directory for /usr and /home in /mnt: sudo mkdir /mnt/usr /mnt/home
then mount the new usr and home to the new root mount: sudo mount /dev/sdb1 /mnt/usr, sudo mount /dev/sdb2 /mnt/home
Then you can do the chroot stuff.
IOW make sure the new usr and home are mounted to the new root first.
I made up the partition names so change as appropriate.

FYI my test system now looks like this (sdc is my original mint disk):
Code: Select all
$ sudo blkid
/dev/sda1: LABEL="ssd" UUID="d9553522-f213-475b-9bc5-5ce8acee5cc1" TYPE="ext4"
/dev/sdb1: LABEL="card usr" UUID="4b54775c-c268-481e-933e-a95f03da2478" TYPE="ext4"
/dev/sdb2: LABEL="card home" UUID="46255024-1bd9-4d9a-8ba7-7d813868a084" TYPE="ext4"
/dev/sdc1: UUID="1de23b16-2066-42cd-9bb9-f49559483aef" TYPE="ext4"
/dev/sdc5: UUID="8905bdc2-9b38-456b-a57b-6696c8a2af0f" TYPE="swap"

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc                                                                  /proc           proc    nodev,noexec,nosuid 0       0

UUID=d9553522-f213-475b-9bc5-5ce8acee5cc1   /                  ext4    errors=remount-ro 0       1
UUID=4b54775c-c268-481e-933e-a95f03da2478   /usr              ext4    defaults  0  1
UUID=46255024-1bd9-4d9a-8ba7-7d813868a084   /home         ext4    defaults 0 1

UUID=8905bdc2-9b38-456b-a57b-6696c8a2af0f    none            swap    sw              0       0

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             3.7G  761M  2.8G  22% /
udev                 1001M  8.0K 1001M   1% /dev
tmpfs                 403M  992K  402M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                 1007M  128K 1007M   1% /run/shm
/dev/sdb1             3.7G  3.0G  570M  85% /usr
/dev/sdb2             3.7G  323M  3.2G  10% /home

$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sdb1 on /usr type ext4 (rw,commit=0)
/dev/sdb2 on /home type ext4 (rw,commit=0)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/bam/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bam)

I didn't bother making a new swap partition for this test.
Last edited by mintybits on Sat May 19, 2012 2:52 am, edited 1 time in total.
mintybits
Level 5
Level 5
 
Posts: 836
Joined: Fri Jan 27, 2012 5:09 pm

Re: How do I install on partitions on 2 different disks?

Postby idc on Sat May 19, 2012 2:46 am

I just replicated what you are doing using a mint Mint 12 installation. Worked fine. rsync had no problems at all. So I suspect it is your card.


Mintybits,
Thank you very much for all your help. It could well be my card. I've got one on order now, so when it arrives I shall see if that solves the problem. It was probably revealing that copying across to the ssd went fine but I got errors for that card. A new class 10 card ought in any case to offer speed improvements over this rather ancient class 6 card, anyway.

Thanks again for all this. I'll let you know how it goes.
Ian
idc
Level 1
Level 1
 
Posts: 18
Joined: Sat Dec 10, 2011 11:11 am

Re: How do I install on partitions on 2 different disks?

Postby idc on Sat May 26, 2012 4:57 am

Hi again,
My card has arrived and I'm ready to go. However, can you offer me any further advice on the partitioning. The ssd I have is a fast disk, though only 4GB; the 16GB sdhc, even though a fast one, is way slower both read and especially write. Should I be seeking to get any particular directories onto the ssd? For example will my programs run very slowly if /usr is installed on the sdhc, or are they mostly just loaded into RAM, so any hit will simply be in starting them up?

If the answer is 'most programs are read into RAM when first started and that therefore the performance hit would be very minor', then I can go for 2 8GB partitions on my 16GB sdhc, set up as /usr and /home. If there *is* a noticeable performance hit then I could, I suppose squeeze /usr on the ssd and simply take a couple of subdirectories like /usr/doc and /usr/locale and put them on the sdhc card. (Actually, I think I can purge much of /usr/locale to save space.)

Thanks for any thoughts or advice you can offer. I'm looking forward to bringing this eeepc back into use and learning programming with my son.

All the best,
Ian
idc
Level 1
Level 1
 
Posts: 18
Joined: Sat Dec 10, 2011 11:11 am

Re: How do I install on partitions on 2 different disks?

Postby idc on Sat May 26, 2012 8:30 pm

Just to say thanks again. I have now followed your instructions and (after a couple of errors and tweaking) am successfully booted in and sending this from the EeePC. Speed seems reasonable, and certainly quite good enough for my son to experiment with programming.

Many thanks, Mintybits, for your help.
Ian
idc
Level 1
Level 1
 
Posts: 18
Joined: Sat Dec 10, 2011 11:11 am

Re: How do I install on partitions on 2 different disks?

Postby mintybits on Sun May 27, 2012 5:51 am

You are welcome. Your question about which parts of the OS should be on the faster card is interesting. I don't know. Everything runs out of RAM. The OS tries to optimise the RAM usage to minimize disk accesses. I suppose it is a matter of what gets swapped in and out of RAM from and to cards most frequently and this will depend on what programs are being run. You might get some idea what's going on by running "htop" and "watch iostat" in separate terminals.

There are ways to optimise SSD performance too. Such as specifying the "noatime" and "discard" options in fstab, and making sure the partitions start on "erase block" boundaries, typically multiples of 1024 (512 byte) sectors, but it depends on your sepcific SSD and memory card.

If it works fast enough now then job done. :)
mintybits
Level 5
Level 5
 
Posts: 836
Joined: Fri Jan 27, 2012 5:09 pm

Re: How do I install on partitions on 2 different disks?

Postby idc on Wed May 30, 2012 4:43 am

Thanks for your reply. I'll look into the options for optimising the SSD and see whether I can improve things further. But you are right, it runs ok now, so my son is happily enjoying looking into Python without any awareness of whether things might be faster if set up slightly differently.

For completeness, and in case it helps someone reading this later, I should add that although the sd card I tried first may have been faulty, I did stumble across something somewhere on the web (and I'm sorry I didn't keep the url) which suggested that there might be problems with the eepc 701 sd card reader, especially when the BIOS option 'install OS' is activated--which of course I had activated as I wanted to install an OS! Anyway, the bigger card is worth having anyway, but I suggest anyone stumbling against this problem might want to try changing that BIOS setting and seeing whether that fixes things. (I never fully understood why the BIOS needed an 'install OS' option anyway; I don't think I've seen one on other computers.)

Thanks again and all the best,
Ian
idc
Level 1
Level 1
 
Posts: 18
Joined: Sat Dec 10, 2011 11:11 am

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: No registered users and 3 guests