Gentoo Archives: gentoo-user

From: Florian Philipp <lists@××××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] migrating disks (from mounts to disklabels
Date: Wed, 17 Nov 2010 22:31:47
Message-Id: 4CE457B0.6080507@f_philipp.fastmail.net
In Reply to: [gentoo-user] migrating disks (from mounts to disklabels by James
1 Am 17.11.2010 22:59, schrieb James:
2 > Hello,
3 >
4 > I have a ~250 gig sata disk I want to migrate to a 2T
5 > Sata disk. This is simple, but, I have a few caveats.
6 >
7 [...]
8 >
9 > Device Boot Start End Blocks Id System
10 > /dev/sda1 * 1 6405 51448131 7 HPFS/NTFS
11 > /dev/sda2 6406 6431 208845 83 Linux
12 > /dev/sda3 6432 14080 61440592+ 83 Linux
13 > /dev/sda4 14081 38913 199471072+ 5 Extended
14 > /dev/sda5 14081 14861 6273351 82 Linux swap / Solaris
15 > /dev/sda6 14862 26335 92164873+ 83 Linux
16 > /dev/sda7 26336 38913 101032753+ 83 Linux
17
18 [...]
19
20 > <needs formatting and file systems installed>
21 >
22 > OK, so I format using fdisk <no big deal>
23 > <new disk will just have /(200G), swap, boot(250M) and one
24 > bit fat /usr/local (1.8T)
25 >
26
27 My advice: dd if=/dev/sda of=/dev/sdb bs=65535
28
29 You end up with a lot of empty space on the end your disk but it is easy
30 to extend your extended partition with GParted (or whatever) and then
31 add new logical partitions.
32
33 Alternative: Migrate to LVM for everything not needed for booting.
34
35 >
36 > Ok now I was going to use same reiserfs < no big deal>
37 > unless I can use reiser4? good idea? <discuss-caveats>
38 >
39
40 I guess you are a die-hard reiserfs user? You should really try ext4.
41 The perceived performance is much better than with ext3. Additional
42 advantages: Its development continues. With the next big patch, it will
43 scale well on multiple CPU cores.[1]
44
45
46 > OK now I want the new fstab to use disklabels
47 > <old dog learning new trick here>
48 >
49 > like this simple (few) partition scheme:
50 > /dev/sdb3 200G 52G 42G 55% /
51 > udev 10M 224K 9.8M 3% /dev
52 > /dev/sdb1 250M 47M 189M 20% /boot
53 > /dev/sdb4 1800G 125G 12G 92% /usr/local
54 >
55 > Current <non disklabel fstab>
56 >
57 > /dev/sda1 /boot reiserfs defaults 1 2
58 > /dev/sda2 none swap sw 0 0
59 > /dev/sda3 / reiserfs defaults 0 1
60 > /dev/sda4 /usr/local reiserfs defaults 0 1
61 > /dev/cdrom /mnt/cdrom auto noauto,ro,user 0 0
62 > /dev/fd0 /mnt/floppy vfat noauto,user,umask=000 0 0
63 > shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
64 > none /proc proc defaults 0 0
65 >
66 > so what does new fstab using disk labels look like?
67 >
68
69 Just replace "/dev/sdb1" with "LABEL=boot", for example. Of course, your
70 file system needs to have that label. For Ext* you set it with `tune2fs
71 -L $label`, `e2label $label` or `mke2fs -L $label`. For reiserfs, it
72 should be similar.
73
74 Another approach (less readable but arguably less easy to break) is
75 using "UUID=...". You can find these out with dumpe2fs. I guess
76 something similar exists for reiserfs, as well.
77
78 > Last, just dd it over like this?
79 > dd if=/dev/sda of=/dev/sdb bs=32768
80 >
81
82 see above.
83
84 Hope this helps,
85 Florian Philipp
86
87 [1]
88 http://thunk.org/tytso/blog/2010/11/01/i-have-the-money-shot-for-my-lca-presentation/

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] migrating disks (from mounts to disklabels Andrea Conti <alyf@××××.net>