View previous topic :: View next topic |
Author |
Message |
trollo n00b
Joined: 10 Sep 2004 Posts: 44 Location: Berlin
|
Posted: Tue Jan 07, 2014 2:27 pm Post subject: Re-partitioning for fresh installation |
|
|
I'm about to re-install my Gentoo system, mainly because my seperate /usr is giving me more trouble than is worth maintaining, but there are also other reasons for me to want a "fresh start", so don't try to talk me out of it.
My problem now is this: I have seperate /usr /opt /var /tmp and /home, all inside a logical volume, but the root partition is outside the LV (I was told that having root inside a LV isn't a good idea back then) and it is only 2GB, which is sufficient if you have a seperate /usr. Now obviously if I get rid of the seperate /usr, I need that disk space for the root partition. And I'd like to keep my /home, of course.
I'm not really an expert on partitioning or LVM (I just use it), so any ideas how to do this are appreciated. My exact disc layout is below.
Thanks.
Code: | # parted /dev/sda
(parted) print
Model: ATA TOSHIBA MK5061GS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary fat16
2 106MB 15.8GB 15.7GB primary ntfs boot
3 15.8GB 231GB 215GB primary ntfs
4 231GB 500GB 270GB extended
5 231GB 231GB 67.1MB logical ext2 boot
6 231GB 235GB 4295MB logical linux-swap(v1)
7 235GB 237GB 2147MB logical ext4
8 237GB 452GB 215GB logical lvm
9 452GB 500GB 48.3GB logical
# fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x08b233a6
Device Boot Start End Blocks Id System
/dev/sda1 2048 206847 102400 6 FAT16
/dev/sda2 * 206848 30926847 15360000 7 HPFS/NTFS/exFAT
/dev/sda3 30926848 450357295 209715224 7 HPFS/NTFS/exFAT
/dev/sda4 450357296 976773167 263207936 5 Extended
/dev/sda5 * 450359344 450490415 65536 83 Linux
/dev/sda6 450492464 458881071 4194304 82 Linux swap / Solaris
/dev/sda7 458883120 463077423 2097152 83 Linux
/dev/sda8 463079472 882509871 209715200 8e Linux LVM
/dev/sda9 882511920 976773167 47130624 83 Linux
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda7 2.0G 276M 1.6G 15% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 136K 1.9G 1% /dev/shm
tmpfs 1.9G 640K 1.9G 1% /run
/dev/mapper/vg-usr 20G 17G 1.8G 91% /usr
cgroup_root 10M 0 10M 0% /sys/fs/cgroup
/dev/mapper/vg-home 119G 98G 15G 87% /home
/dev/mapper/vg-opt 5.0G 306M 4.4G 7% /opt
/dev/mapper/vg-var 9.9G 568M 8.8G 6% /var
/dev/mapper/vg-tmp 2.0G 68M 1.9G 4% /tmp
/dev/sda5 62M 31M 29M 53% /boot |
|
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9663 Location: almost Mile High in the USA
|
Posted: Tue Jan 07, 2014 4:23 pm Post subject: |
|
|
I'd say for a single user machine, who would kill themselves if they killed the machine (versus kill other people sharing the machine), just use one big partition for Linux.
At least that's what I do, makes it much easier to work with. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
Voltago Advocate
Joined: 02 Sep 2003 Posts: 2593 Location: userland
|
Posted: Tue Jan 07, 2014 5:41 pm Post subject: |
|
|
Even for a single user machine, I'd say a separate /home partition is a good idea. Everything else can indeed be mushed into / without any trouble. |
|
Back to top |
|
|
trollo n00b
Joined: 10 Sep 2004 Posts: 44 Location: Berlin
|
Posted: Wed Jan 08, 2014 12:37 pm Post subject: |
|
|
Voltago wrote: | Even for a single user machine, I'd say a separate /home partition is a good idea. Everything else can indeed be mushed into / without any trouble. |
How would I do this in my setup without losing my current /home? |
|
Back to top |
|
|
Voltago Advocate
Joined: 02 Sep 2003 Posts: 2593 Location: userland
|
Posted: Wed Jan 08, 2014 5:24 pm Post subject: |
|
|
trollo wrote: | Voltago wrote: | Even for a single user machine, I'd say a separate /home partition is a good idea. Everything else can indeed be mushed into / without any trouble. |
How would I do this in my setup without losing my current /home? |
No idea, frankly. I've never bothered with LVM, or even secondary DOS partitions if I didn't absolutely need to. Backing up to an external drive is probably the easiest thing to do. |
|
Back to top |
|
|
zeek Guru
Joined: 16 Nov 2002 Posts: 480 Location: Bantayan Island
|
Posted: Wed Jan 08, 2014 7:59 pm Post subject: |
|
|
I use a 64GB partition to hold the base system and put everything else in a data partition:
Code: | ~ # parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: DELL PERC H710P (scsi)
Disk /dev/sda: 7999GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 68.7GB 68.7GB xfs
2 68.7GB 7999GB 7931GB xfs
(parted) quit |
|
|
Back to top |
|
|
RazielFMX l33t
Joined: 23 Apr 2005 Posts: 835 Location: NY, USA
|
Posted: Wed Jan 08, 2014 8:06 pm Post subject: |
|
|
I often opt for a more complex partitioning scheme (note, this is a GPT partitioned disk):
Code: |
# parted /dev/sda
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit mib
(parted) p
Model: ATA ST1000DM003-1CH1 (scsi)
Disk /dev/sda: 953870MiB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1.00MiB 513MiB 512MiB fat32 ESI boot
2 513MiB 1025MiB 512MiB ext4 boot
3 1025MiB 17409MiB 16384MiB linux-swap(v1) swap
4 17409MiB 148481MiB 131072MiB ext4 rootfs
5 148481MiB 181249MiB 32768MiB jfs var
6 181249MiB 476935MiB 295686MiB jfs home
7 476935MiB 493319MiB 16384MiB jfs tmp
8 493319MiB 951820MiB 458501MiB jfs extra
9 951820MiB 953869MiB 2049MiB fat32 HP_TOOLS
(parted) quit
|
This is 1TB drive with a partition I called 'extra' for when I need to copy off partitions to defrag or change file systems (I occassionally like messing with file systems to try them out; it's how I discovered I really liked jfs). |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54174 Location: 56N 3W
|
Posted: Wed Jan 08, 2014 9:47 pm Post subject: |
|
|
trollo,
I would keep /var/log outside of root. Its very painful if root gets filled up accidently.
You box won't boot any more.
I agree with a separate /home too.
What is the issue with maintaining a separate /usr?
I'm still using the initramfs I made in 2009. It does not contain any kernel modules, so its effectively firmware. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Syl20 l33t
Joined: 04 Aug 2005 Posts: 619 Location: France
|
Posted: Fri Jan 10, 2014 1:10 pm Post subject: |
|
|
trollo wrote: | How would I do this in my setup without losing my current /home? |
Backup your data on a separate disk (it is always a good idea, anyway), and then you can repartition your disk from scratch. |
|
Back to top |
|
|
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Sat Jan 11, 2014 1:47 pm Post subject: |
|
|
I see very little merrit in breaking up a desktop partition in to many partitions.
A split /usr system makes many operations more difficult.
A seperate /opt can be useful if it is a multi-usr system. However on a single user system, I generally just keep less posix-compliant software in my home directory.
A seperate /var makes sense if you are running a web/mail server. If not the size isn't going to change much
I do recommend keeping /boot and /home seperate
here is my setup
rootfs 58G
/home 522G
swap 8G
/boot 120M
Yes I know the numbers are weird, I had never heard of a 660G HD but thats how big it is.
120M for boot is excessive. If you run LILO or syslinux and only have one kernel at a time you could get by with 10M, I build a lot of kernels. |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sat Jan 11, 2014 1:55 pm Post subject: |
|
|
mreff555 wrote: | A split /usr system makes many operations more difficult. |
I used to have a separate /usr but got rid of it when the problems started. If you have a partition for everything, your root / partition will be empty and therefore pointless anyway. Doesn't hurt /usr to be merged with a few tiny /etc and /dev files, so your /usr partition is your new root partition. You can still have partitions for everything else if you prefer.
( I repeat myself https://forums.gentoo.org/viewtopic-p-7447314.html#7447314 ) |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Sat Jan 11, 2014 3:22 pm Post subject: |
|
|
In fact my (separate) /var partition is the only one that's ever been corrupted
enough in a power failure to require reformatting. I run separate /boot, /usr
/home, /var and /usr/portage, but that's more for convenience than performance.
A separate /boot is handy for laptops since you don't have to mess with Window's
neurotic attitudes to partitioning, and can just boot through the Windows menu
to grub - once that's set up, you never have to touch it again except to edit
grub.conf. Installing grub makes me nervous.
A separate home is pretty much essential for an easy life, since that's what
really needs regular backups.
I use a separate /usr/portage partition since it has a lot of small files, and
churn, and I share it between builds.
Typically each of those partitions is 16G, with very large data partitions
attached as required under /home
Will |
|
Back to top |
|
|
|