You are not logged in.

#1 2012-04-15 11:30:05

4on6
Member
Registered: 2011-10-05
Posts: 172

[SOLVED] Clone Archlinux to USB flash drive

Hello,
I want to clone an existing Archlinux installation (x86-64)  from a hard drive to a 32 GB USB flash drive. I want to be able to boot from the USB stick on my Win7 labtop.
I already took some measures to prepare my hard drive (with gparted). After moving all movies, pics etc to external stores and shrinking the home drive (sda4), it now looks like this:

- sda1 Boot (small)
- sda2 Swap (small)
- sda3 Root ( ca.8GB)
- sda4 Home (ca. 22GB)

I tried to take an image of the entire hard-disk (ca. 250GB) with clonezilla and restore it to the USB flash drive, but got an error message - original disk to big (250GB vs 32GB), besides only ca 30GB of the 250GB being assigned to partitions.

Now I'm looking for a way to bring only the necessary partitions from the harddisk to the USB stick, hoping to have exactly the same Archlinux configuration as a bootable installation on the USB stick afterwards (bootable on a Win7 labtop ... and maybe from my main Archlinux machine too). There is a wiki article about the topic, but its rather about installing a fresh system than cloning an existing system. The related questions on the forum (searching in 'installation' for 'clone usb') did not answer my question.

Maybe somebody did successfully what I'm planning to do and can give me some tips?

Last edited by 4on6 (2012-04-16 12:57:01)

Offline

#2 2012-04-15 12:43:30

bjornoslav
Member
Registered: 2011-11-01
Posts: 137

Re: [SOLVED] Clone Archlinux to USB flash drive

I succeeded by creating two new partitions on the flash drive, the / (6 GiB) and /home (all the rest), boot and swap are unnecessary; swapping on a flash drive will wear it out sooner, and you'd boot only one OS, so why having /boot?

Boot from a live medium of Arch or any distro you wish, mount the source partitions of your hard drive and copy their contents to the destination flash partitions by using rsync as root:

rsync -av /mnt/source/ /mnt/dest/

Don't forget the slash / after source!
Then, do the same and copy the contents of the boot partition to the /boot folder on the flash drive's root partition, again using rsync as above.
Edit /boot/grub/menu.lst and replace all the root disk definitions with UUID of the root partition on the flash disk, for example:

...

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /boot/vmlinuz-linux root=UUID=type-the-uuid-here ro
initrd /boot/initramfs-linux.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,0)
kernel /boot/vmlinuz-linux root=UUID=type-the-uuid-here ro
initrd /boot/initramfs-linux-fallback.img

...

Change the /etc/fstab file on the root partition of the flash disk, replace the UUID's with the one of the partitions on the flash disk:

tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
UUID=c98e6f27-886a-4a7e-91c3-be582f9b6f27 / ext4 defaults,noatime 0 1
UUID=fbc29c8d-5fba-4f8d-a8af-efa6760a2c59 /home ext4 defaults,noatime 0 1
tmpfs		/media	tmpfs	defaults	0	0

Install GRUB on the flash disk as root:

grub --root-directory=/mnt/flash_disk_root/boot/ /dev/sdX

Replace X with the letter that corresponds to your flash drive.

RECHECK anything you type as root before executing the commands!

Boot from USB (reboot PC, choose the BIOS boot menu, it's usually ESC, F11, F8 etc.)
Enjoy your USB installation :3
Cheers.


asus ux303la, core i5@1.6ghz, 8 gb ram, 500gb hdd, hd4400 gpu, crux x64 with openbox

Offline

#3 2012-04-15 13:04:24

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Clone Archlinux to USB flash drive

You only need the files from sda3 (root) and the dot files from your home dir. Use a "Live" distro (Arch install, Ubuntu, Parted Magic, etc) to do it.

For 2 GB RAM (and up) you don't need swap. Swap/pagefile isn't even recommended for flash media. If you want, you can mount a swap file (which is very much like the pagefile.sys) from one of the NTFS partitions.

You can either install a bootloader to the USB stick or you can add an entry to the one installed on the laptop/PC/potato.


A "32 GB" stick is actually 30 GB, right? If it were me, I would probably use gparted to create a 20 GB NTFS partition for storage (NTFS because of FA32's 4 GB file limit) and a second, 10 GB EXT4 partition for Arch. No separate /boot or /home and especially not swap. Why would you need separate partitions for, anyway? My entire system is on one partition and has been for the last 4 years. I like to keep my dot files separate from storage drives. wink

Note: Though it may seem like a rehash of what bjornoslav said, I was already in the process of writing this so I figured what the hell, I should post it anyway.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#4 2012-04-15 13:53:26

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

Thank you very much for the detailled information!
I still have a few questions, that might seem a bit naive, but I don't want to mess up things:

bjornoslav wrote:

I succeeded by creating two new partitions on the flash drive, the / (6 GiB) and /home (all the rest), boot and swap are unnecessary; swapping on a flash drive will wear it out sooner, and you'd boot only one OS, so why having /boot?

Create two new partitions - with gparted p.ej.? And do I have to worry about the filesystems - must they be the same like for the original partitions on my hard-disk?

Boot from a live medium of Arch or any distro you wish, mount the source partitions of your hard drive and copy their contents to the destination flash partitions by using rsync as root:

rsync -av /mnt/source/ /mnt/dest/

So I mount both - source and destination partitions (/mnt/dest/ suggests it ...)?

Don't forget the slash / after source!
Then, do the same and copy the contents of the boot partition to the /boot folder on the flash drive's root partition, again using rsync as above.

I create that /boot folder on the flash drives root partition, right? Won't that cause problems later on with rsync, when I update the installation and there is an additional folder on the target partition?

Edit /boot/grub/menu.lst and replace all the root disk definitions with UUID of the root partition on the flash disk, for example:

...

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /boot/vmlinuz-linux root=UUID=type-the-uuid-here ro
initrd /boot/initramfs-linux.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,0)
kernel /boot/vmlinuz-linux root=UUID=type-the-uuid-here ro
initrd /boot/initramfs-linux-fallback.img

...

I've seen those UUIDs as output of a linux command (mount? fdisk?), but I don't recall which one - how do I get these UUIDs?

Change the /etc/fstab file on the root partition of the flash disk, replace the UUID's with the one of the partitions on the flash disk:

tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
UUID=c98e6f27-886a-4a7e-91c3-be582f9b6f27 / ext4 defaults,noatime 0 1
UUID=fbc29c8d-5fba-4f8d-a8af-efa6760a2c59 /home ext4 defaults,noatime 0 1
tmpfs		/media	tmpfs	defaults	0	0

Install GRUB on the flash disk as root:

grub --root-directory=/mnt/flash_disk_root/boot/ /dev/sdX

Replace X with the letter that corresponds to your flash drive.

Do I send this command from the live Arch-CD, and is it the only command necessary (I have not much experience with grub)?


RECHECK anything you type as root before executing the commands!

I will ...

Boot from USB (reboot PC, choose the BIOS boot menu, it's usually ESC, F11, F8 etc.)
Enjoy your USB installation :3
Cheers.

Great that this is possible, hope I manage to get it done. Thanks again.

Cheers

Offline

#5 2012-04-15 14:07:12

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

DSpider wrote:

You only need the files from sda3 (root) and the dot files from your home dir. Use a "Live" distro (Arch install, Ubuntu, Parted Magic, etc) to do it.

For 2 GB RAM (and up) you don't need swap. Swap/pagefile isn't even recommended for flash media. If you want, you can mount a swap file (which is very much like the pagefile.sys) from one of the NTFS partitions.

You can either install a bootloader to the USB stick or you can add an entry to the one installed on the laptop/PC/potato.


A "32 GB" stick is actually 30 GB, right?

Ups, 32 GB is actually 30GB? Then my partitions might either fit exactly, or I have to use gparted again to shrink home a bit more.

If it were me, I would probably use gparted to create a 20 GB NTFS partition for storage (NTFS because of FA32's 4 GB file limit) and a second, 10 GB EXT4 partition for Arch. No separate /boot or /home and especially not swap.

Ah,  that answers one of my questions in my second post.
No problems when the original /home partition is EXT4 and the data is then copied to an NTFS partition? No problems with software that expects a /home partition on a linux system? While it sounds reasonable what you propose, I ask myself if it would not be better and less risky to use a 20GB EXT4  /home  partition on the USB flash drive just like on the original hard drive?

Why would you need separate partitions for, anyway? My entire system is on one partition and has been for the last 4 years. I like to keep my dot files separate from storage drives. wink

Note: Though it may seem like a rehash of what bjornoslav said, I was already in the process of writing this so I figured what the hell, I should post it anyway.

I'm glad you posted it - thanks a lot for your help.

Offline

#6 2012-04-15 16:33:10

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Clone Archlinux to USB flash drive

No problems with software that expects a /home partition on a linux system?

Software doesn't care where (or what) your /home is mounted on. They will point to "~/" or "$HOME" just fine.


I have to ask, though... What exactly are you planning on using this USB stick for? Common sense tells me that it's not going to be the primary OS used on the laptop, with the USB drive sticking out like that. If you only sparingly use Linux why not try some other pre-built "Live" distribution like Ubuntu, Linux Mint, PCLinuxOS, etc. ? It'd be easier and you can get away with as little as 700 MB instead of how-many GB.

Last edited by DSpider (2012-04-15 16:38:22)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#7 2012-04-15 17:26:51

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

DSpider wrote:

No problems with software that expects a /home partition on a linux system?

Software doesn't care where (or what) your /home is mounted on. They will point to "~/" or "$HOME" just fine.


I have to ask, though... What exactly are you planning on using this USB stick for? Common sense tells me that it's not going to be the primary OS used on the laptop, with the USB drive sticking out like that. If you only sparingly use Linux why not try some other pre-built "Live" distribution like Ubuntu, Linux Mint, PCLinuxOS, etc. ? It'd be easier and you can get away with as little as 700 MB instead of how-many GB.

Ok, thanks.
Well I want to use the stick to be able to work in my normal Archlinux environment on my win7 labtop without losing the comfort of being able to rely on windows again when there are some linux problems (expecially with hardware).
I tried double boot and VMs before, but both trials did not result so well, so I did not want to touch the original win7 hard-disk this time.

I'm still working on it, lets see if it works out.  I will give feedback.

Offline

#8 2012-04-15 22:50:47

bjornoslav
Member
Registered: 2011-11-01
Posts: 137

Re: [SOLVED] Clone Archlinux to USB flash drive

4on6 wrote:

Create two new partitions - with gparted p.ej.? And do I have to worry about the filesystems - must they be the same like for the original partitions on my hard-disk?

I prefer Gparted, it's easy as cake tongue
The filesystems don't have to be the same as the original partitions. I prefer ext4 (universally supported) or jfs (uses very little CPU), but I recommend you ext4.
In fact, you can use a hard drive instead of a flash drive and this is how you clone a Linux installation manually! smile

4on6 wrote:

So I mount both - source and destination partitions (/mnt/dest/ suggests it ...)?

Yes. I mount the source partition in /mnt/source and the destination partition in /mnt/dest, and then I issue

rsync -av /mnt/source/ /mnt/dest

and wait for it to finish. Then I unmount the partitions and mount the other ones and repeat the same thing.

4on6 wrote:

I create that /boot folder on the flash drives root partition, right? Won't that cause problems later on with rsync, when I update the installation and there is an additional folder on the target partition?

Since the root directory you'll aready copy on the flash disk won't have the /boot directory, simple do a

mkdir /mnt/dest/boot

while your destination partition is still mounted. Unmount the source root partition, mount the boot one and then type:

rsync -av /mnt/source/ /mnt/dest/boot

and GRUB and the kernel will be copied to the /boot folder on the destinaton partition on the flash disk.
Make sure that in /mnt/dest/etc/fstab you comment out the line for mounting the /boot partition, if any.

4on6 wrote:

I've seen those UUIDs as output of a linux command (mount? fdisk?), but I don't recall which one - how do I get these UUIDs?

Use Gparted, right click any partition and click Information. In the window that appears, in the middle you can double-click the UUID and press Ctrl-C to copy it. Then you can paste it in the text editor and use it for /etc/fstab or /boot/grub/menu.lst. That's why I love Gparted for such stuff. smile

4on6 wrote:

Do I send this command from the live Arch-CD, and is it the only command necessary (I have not much experience with grub)?

Yes, since Arch uses GRUB 1 on the installation CD you can uste the command I gave you to reinstall GRUB on the flash disk with the settings you already entered for the /boot/grub/menu.lst file.
Make sure you boot the CD in 64 bit mode if the Arch you installed is 64 bit. Just to be safe. smile

4on6 wrote:

I will ...

Be very careful, I didn't and lost ALL my files by mistake in typing. Triple-check the directory you are currently working in! ALWAYS make a backup! wink

4on6 wrote:

Great that this is possible, hope I manage to get it done. Thanks again.

You're welcome. Please inform me if this little tutorial suited you so I can make a wiki entry for it, if the admins allow.


asus ux303la, core i5@1.6ghz, 8 gb ram, 500gb hdd, hd4400 gpu, crux x64 with openbox

Offline

#9 2012-04-15 22:51:36

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

Ok, now I followed all the steps as described by bjornoslav, with one minimal syntax correction:
I used

grub-install  --root-directory=/mnt/flash_disk_root /dev/sdX

as the last command of the recipe.

Now when I boot my Win7 machine, the USB flash-drive is recognized and the GNU Grub boot screen with Arch Linux and Arch Linux Fallback is shown. However, when I choose any of the two options, I get the following error:

Booting 'Arch Linux'
root (hd0.0)
Filesysystem type is ext2fs. partition type 0x83
kernel /vmlinuz-linux root=/dev/disk/by-uuid/51069cdf-...c2 ro

Error 15: File not found

Press any key to continue....

The UUID is the one I copied into /etc/fstab.
Not sure about the (hd0.0), that was shown to me after installing grub, but I could not tell right from wrong in this case.
The filesystem type is wrong - the root partition of the USB stick is EXT4, not EXT2, the other partiton is NTFS. Maybe something went wrong when I copied the content from the original boot partition of my hard-drive (sda1= EXT2) to the /boot directory of the USB-stick root partition (= EXT4)?

It seems I almost made it, would be nice to boot the USB stick successfully. Any hints to the possible error-cause are welcome.

Last edited by 4on6 (2012-04-15 22:52:49)

Offline

#10 2012-04-15 23:02:16

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

bjornoslav Thanks a lot again, I cross-posted at the same time like you, it almost worked out fine, your recipe would make a perfect wiki entry, except something went wrong with the names, I guess. Not sure how to do the diagnosis.

Offline

#11 2012-04-15 23:51:08

bjornoslav
Member
Registered: 2011-11-01
Posts: 137

Re: [SOLVED] Clone Archlinux to USB flash drive

Edit the file /boot/grub/menu.lst on the root partition of the flash disk and just do this to the lines like these:

kernel /vmlinuz-linux root=/dev/disk/by-uuid/51069cdf-...c2 ro

Replace /vmlinuz-linux with /boot/vmlinuz-linux and it will work. 100% wink


asus ux303la, core i5@1.6ghz, 8 gb ram, 500gb hdd, hd4400 gpu, crux x64 with openbox

Offline

#12 2012-04-16 01:11:31

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

bjornoslav wrote:

Edit the file /boot/grub/menu.lst on the root partition of the flash disk and just do this to the lines like these:

kernel /vmlinuz-linux root=/dev/disk/by-uuid/51069cdf-...c2 ro

Replace /vmlinuz-linux with /boot/vmlinuz-linux and it will work. 100% wink


Almost wink
I had to change the

initrd /initramfs-linux.img

lines to

initrd /boot/initramfs-linux.img

too, before booting continued.

However, then I saw the very same error-message again that I had just recently after an update of my Arch linux machine:

Triggering uevents ...done
waiting 10 sec for device '/dev/disk/by-uuid/51069cdf- ...
ERROR: device not found. Skipping fsck. 
ERROR: unable to find root device...
You are dropped to recovery shell...

 

Thats a bit strange, since I repaired this on my linux machine following advice from the wiki and from forum members, and the USB stick is a clone of my repaired and working (= booting) system.

Last edited by 4on6 (2012-04-16 10:26:57)

Offline

#13 2012-04-16 10:45:46

bjornoslav
Member
Registered: 2011-11-01
Posts: 137

Re: [SOLVED] Clone Archlinux to USB flash drive

Boot from the source hard disk. As root, edit the /etc/mkinitcpio.conf file on the source root partition and add usb to the HOOKS section.
For example, at my PC it looks like this:

...
HOOKS="base udev autodetect pata sata usb filesystems usbinput fsck"
...

Then execute this as root:

mkinitcpio -p linux

When this finishes, use rsync as root to copy the mkinitcpio.conf  file to the /etc folder of the destination root partition of the flash disk, and also use rsync to copy the boot partition from the hard drive to the /boot folder of the destination root partition. Execute the grub-install command again

grub-install  --root-directory=/mnt/flash_disk_root/ /dev/sdX

where X is a letter [a-z] that corresponds to the flash disk. Retry booting from the USB and tell me if it worked.


asus ux303la, core i5@1.6ghz, 8 gb ram, 500gb hdd, hd4400 gpu, crux x64 with openbox

Offline

#14 2012-04-16 12:20:04

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

COOL!
That worked, after following the instructions of your last post, and changing the /grub/menu.lst on the USB stick again (change UUID, add /boot to the dir names), I can now boot my authentic Archlinux installation on my Win7 labtop. That rocks!

The only difference comes from the keymappings. I use specialised emacs keybindings for my keyboard, that don't apply to the labtops keyboard with less keys and different key locations.

This would really make a great wiki entry.

Before marking the thread as solved, I have one more consideration: the workflow to keep harddisk and usb-stick in sync. There will be changes on both sides, at least in the /home folders. But, e.g., when I adapt the keybindings on the labtop, there will be differences on the / partions too. How do I then update the USB stick without losing all special configurations only related to the USB stick? Or, put it another way, can I have different keymaps that are used conditionally on the type of machine I boot on?

How do you keep everything in sync without shooting yourself in the foot (since the USB stick should function as a kind of security backup too)?

How do you make an exact clone of the USB stick on another USB stick - with clonezilla or simply 'dd' (a backup of the backup, so to say)?

Thanks again for your help.
Cheers.

Last edited by 4on6 (2012-04-16 12:34:28)

Offline

#15 2012-04-16 12:49:39

bjornoslav
Member
Registered: 2011-11-01
Posts: 137

Re: [SOLVED] Clone Archlinux to USB flash drive

4on6 wrote:

COOL!
That worked, after following the instructions of your last post, and changing the /grub/menu.lst on the USB stick again (change UUID, add /boot to the dir names), I can now boot my authentic Archlinux installation on my Win7 labtop. That rocks!

I'm glad I could help you! smile

4on6 wrote:

This would really make a great wiki entry.

I'll consolidate the whole process in a wiki by the end of this week.

4on6 wrote:

Before marking the thread as solved, I have one more consideration: the workflow to keep harddisk and usb-stick in sync. There will be changes on both sides, at least in the /home folders.

How do you keep everything in sync without shooting yourself in the foot (since the USB stick should function as a kind of security backup too)?

I believe keeping the root partitions and the boot one would be hard (because of the UUID's in /etc/fstab and /boot/grub/menu.lst.
But syncing the /home folders is piece of cake! Just by running

rsync -av /home/ /mnt/mounted_home_partition_from_flash_disk

as root in the shell with no X started will sync all user profiles with the ones on the flash disk, updating only the changed files.
You may also run it while you're logged in, but if you have any running programs, their settings may not be preserved (maybe they made new files while rsync was backing up the existing ones).
Or you may even sync them via network, while you're away from home or while you use two different computers. Read this:
https://wiki.archlinux.org/index.php/Rs … p_with_SSH

4on6 wrote:

How do you make an exact clone of the USB stick on another USB stick - with clonezilla or simply 'dd' (a backup of the backup, so to say)?

You can try dd, but I would advise you to follow this same tutorial and just use the source flash disk as source and the new one you want to copy to as destination, because there will be less wearing and the file system will be more ordered (i.e. not fragmented) and quicker to access.

If you use dd with the whole disk (for example, /dev/sdX and not /dev/sdX1), if the destination flash disk is larger than the source one, you may not be able to use the free space because dd will copy the MBR and disk descriptor data from the original flash disk on the destination flash disk and the destination one will represent itself as having a size less than it should. You can fix that by creating a new partition table on the destination disk, but you will delete everything on that flash disk. So it's not worth the effort. smile

4on6 wrote:

Thanks again for your help.
Cheers.

You're welcome! big_smile


asus ux303la, core i5@1.6ghz, 8 gb ram, 500gb hdd, hd4400 gpu, crux x64 with openbox

Offline

#16 2012-04-16 12:56:56

bjornoslav
Member
Registered: 2011-11-01
Posts: 137

Re: [SOLVED] Clone Archlinux to USB flash drive

4on6 wrote:

How do I then update the USB stick without losing all special configurations only related to the USB stick? Or, put it another way, can I have different keymaps that are used conditionally on the type of machine I boot on?

You can make an exclude list of files that rsync won't copy.  From the rsync man page:

            --exclude=PATTERN       exclude files matching PATTERN
            --exclude-from=FILE     read exclude patterns from FILE

So for example:

 rsync -av --exclude=/home/*/.* /home/ /mnt/dest_home_partition

You can add as many --exclude patterns as you want. This one won't copy the hidden configuration files of all users, but will copy all the other files (documents, music, pictures, videos...). Tweak it as you need.

Cheers smile


asus ux303la, core i5@1.6ghz, 8 gb ram, 500gb hdd, hd4400 gpu, crux x64 with openbox

Offline

#17 2012-04-16 13:01:44

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

I have to learn more about rsync, quite powerfull command it seems.
Thanks, I just marked the thread as solved.

Offline

#18 2012-04-16 13:06:27

bjornoslav
Member
Registered: 2011-11-01
Posts: 137

Re: [SOLVED] Clone Archlinux to USB flash drive

You're welcome. Read the rsync man page, it has usage examples in it. smile


asus ux303la, core i5@1.6ghz, 8 gb ram, 500gb hdd, hd4400 gpu, crux x64 with openbox

Offline

#19 2012-04-17 16:32:01

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Clone Archlinux to USB flash drive

Just some final remarks:
in order to make my cloned Arch Linux USB flash drive installation run on my Samsung R730 notebook, I had to do the following:

  1. install acpi and acpid and put acpid in the list of daemons in rc.conf.

  2. install a graphics driver to be able to run X11. Samsung product description talks about Nvidia Gforce graphics card and GMA HD, so I wasn't sure if Intel or Nvidia drivers are appropriate in this case and installed xf86-video-intel, it seems a bit slow, but it works.

  3. delete and clone the git aur-mirror again, since somehow git complained all packages have been modified locally although I did not touch them - besides copying them with rsync.

  4. adapt my console keybindings by modifying (in my case) /usr/share/kbd/keymaps/i386/quertz/de-latin1-nodeadkeys-emacs.map.gz (using 'sudo showkey -k' to get the keycodes.

  5. adapt my X11 keybindings in ~/.Xmodmap to the layout of the Samsung notebook keyboard (using 'sudo xbindkeys -mk' to get the keycodes).

EDIT1:
Furthermore, I used EXT4 filesystem for the / (root) partition and NTFS for the /home partition, only to find out that ntfs-3g doesn't support file ownership and permissions. Thus, if you don't have a compelling reason to use NTFS, I would suggest to use EXT4 (or relatives) for both partitions.

EDIT2:
When preparing a second USB flash drive, I use gparted to get two EXT4 partitions on a msdos filesystem as described above, and then copy the root partition from usb1 with rsync to the root partition of usb2 (and then do the same with the /home partitions).

However, to make usb2 boot, I had to do the following (again):

  • get the UUIDs of both partitions of usb2 with

    ls -l /dev/disk/by-uuid
  • modifiy /etc/fstab with the new UUIDs (root partition of usb2)

  • modify /boot/grub/menu.lst with the new (root) UUID (root partition of usb2) and make a backup copy of menu.lst outside the /grub folder (because, in my case, in the next step this file was lost)

  • delete the /boot/grub folder on the root partition of usb2 and reinstall grub:

    grub-install --root-directory=/mnt/usb2_flash_disk_root   /dev/sdX

    with X being the letter for the usb2 flash drive (in my case it was b -> /dev/sdb, but check with 'sudo fdisk -l')

  • check the new /boot/grub folder on the root partition of usb2, and in case menu.lst is missing, copy your backup file back here.

EDIT3:
Its probably a good idea to modify the host name in /etc/rc.conf and /etc/hosts in the root partition of each USB flash drive installation to something like arch1, arch2 ..., to avoid total confusion while dealing with several almost identical Arch systems.

Another useful idea might be to have a 'keymaps' folder in your Dropbox folder (or some Git managed folder) with a pair of keymaps (one console keymap, one .Xmodmap) for each keyboard you work with. That way, it might become very quick to startup your fully customized Arch system with your specialised (Emacs) keybindings via USB stick on any foreign computer -  just modify the most similar set of keymaps in your collection and save the result for future usage.

Last edited by 4on6 (2012-04-19 23:17:38)

Offline

Board footer

Powered by FluxBB