[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to make more space available for /



Jochen Spieker wrote on 09/28/2014 12:07:
> Rob Hurle:
>>
>> […] Any ideas on how I can copy my existing / partition and boot
>> information to a new disc?  Would dd be a good idea?  How can I
>> prepare the new disc to be the boot disc and have / on it without
>> disturbing my current system?
> 
> There are many ways to skin this cat, but generally you only need to:
> 
> - prepare the target disk (partitioning, possibly LVM, filesystems)
> - copy the data
> - adjust config files (fstab, boot loader)
> - install boot loader to new disk
> 
> You generally don't need to worry about disturbing the currently running
> system. You should probably copy the root file system in single user
> mode anyway. 

For this purpose I'd make a mount directory on another partition, e.g.
/home/mnt, and remount / there:

  mount --bind / /home/mnt

Then you can copy the files in root from there (/home/mnt) to your new
root-partition without the trees mounted in /. Take a look into /home/mnt, the
directories under the mount points are all accessible.
But for any partition avoid to copy the /lost+found (if using ext4, e.g.)
directory. When done just "umount /home/mnt".

> The only pitfall I can think of right now is if you copy
> filesystems using dd you end up with multiple filesystems with the same
> UUID. I would avoid that and copy the files using rsync or tar.
> 
>> In these days of udev and UUIDs, can we just alter /etc/fstab and
>> still expect partitions to be mounted?
> 
> Generally yes. There's no magic involved.
> 
> BTW, this is one of the scenarios where LVM shines.
> 
> J.
> 
-- 
Regards,
jvp.



Reply to: