Changing the /usr partition

opensuse 13.2
linux 3.16.7-7-desktop x86_64

I recently purchased an Axiom SSD unit, 160GB. I partitioned it into two volumes, one for /usr, the other for / (root). I copied /usr using rsync:

OPTS='--recursive --one-file-system --links --stats --itemize-changes --quiet --delete --times -HAXS';
rsync ${OPTS} --log-file=${LOGFILE} /usr /mnt/usr1/

I thought that all I had to do then was modify /etc/fstab and restart. Not so. It became unbootable. I had to use the Rescue Disk to change the fstab settings back to the previous.

/dev/disk/by-id/scsi-SSEAGATE_ST336753LW_3HX0G0GM000073370Y4S-part3    /usr    ext4    acl,user_xattr 1 2 
# /dev/disk/by-id/scsi-SSEAGATE_ST336753LW_3HX0G0GM000073370Y4S-part3   /mnt/usr1    ext4    acl,user_xattr 1 2 
#
/dev/disk/by-id/ata-Axiom_Signature_Series_III_SSD_AX150206AS1706441-part2 /mnt/usr1 xfs  defaults   1 2
# /dev/disk/by-id/ata-Axiom_Signature_Series_III_SSD_AX150206AS1706441-part2 /usr xfs defaults   1 2

So. What did I miss when copying /usr and changing mount points?

I’m just guessing here, but it is possible that “/usr” is being mounted from the “initrd”. So you might need to remake that from a suitable “chroot()” environment.

I modified fstab for the new /usr volume, ran mkinitrd, restarted. The boot hung in the same place. After reverting fstab, the system started normally.

As you did not post what you did with rsync complete (prompts are missing) we can not check as which user you did it.

Also your fstab is not complete, thus checking against the other entries is impossible.

Did you at least look inside /mnt/usr1 to check if it looks the same as what you see inside /usr? In other words, if your rsync action resulted in what you intended to do with it?

The script was run as root.

Also your fstab is not complete, thus checking against the other entries is impossible.

#
/dev/disk/by-id/scsi-SSEAGATE_ST336753LW_3HX0G0GM000073370Y4S-part1    swap    swap    defaults 0 0 
/dev/disk/by-id/scsi-SSEAGATE_ST336753LW_3HX0G0GM000073370Y4S-part2    /    ext4    acl,user_xattr 1 1 
/dev/disk/by-id/scsi-SFUJITSU_MAW3073NP_DAS0P740510C-part1    /home    ext4    acl,user_xattr 1 2 
#
/dev/disk/by-id/scsi-SSEAGATE_ST336753LW_3HX0G0GM000073370Y4S-part3    /usr    ext4    acl,user_xattr 1 2 
# /dev/disk/by-id/scsi-SSEAGATE_ST336753LW_3HX0G0GM000073370Y4S-part3   /mnt/usr1    ext4    acl,user_xattr 1 2 
#
UUID=2658fa01-ad6e-4e5f-bfac-f2e9d7742321 /mnt/root1           btrfs      defaults              0 0
/dev/disk/by-id/ata-Axiom_Signature_Series_III_SSD_AX150206AS1706441-part2 /mnt/usr1  xfs   defaults              1 2
# /dev/disk/by-id/ata-Axiom_Signature_Series_III_SSD_AX150206AS1706441-part2 /usr  xfs        defaults              1 2
#
LABEL=data_storage    /d500g    ext4    acl,user_xattr 1 2 
#
/dev/disk/by-id/ata-BUFFALO_External_HDD_._Z240RTNL-part1 /backup01            ext4       defaults              1 2
# UUID=f800bf7f-3eb7-40fa-a326-fd61d994ed59    /backup01    btrfs    defaults 1 2 
#
#  Create /tmp in RAM
# tmpfs /tmp     tmpsfs mode=1777 size=100m     0 0
#
//sma-nas-02/pub-data    /t-smb    cifs    credentials=/home/jmoe/.smb/.smbpw,uid=sma-user4,gid=users,file_mode=0664,dir_mode=0775,noserverino,noperm 0 0 
//sma-nas-02/graphics    /w-smb    cifs    credentials=/home/jmoe/.smb/.smbpw,uid=sma-user4,gid=users,file_mode=0664,dir_mode=0775,noserverino,noperm 0 0 
#
# //sma-server1/PUB-DATA /t2 cifs credentials=/home/jmoe/.smb/.smbpw,uid=sma-user4,gid=users,file_mode=0664,dir_mode=0775,sec=lanman,servern=SMA-SERVER1,ip=192.168.69.249,port=139,nocase,noperm,nounix,noserverino 0 0 
# //sma-server1/GRAPHICS /w2 cifs credentials=/home/jmoe/.smb/.smbpw,uid=sma-user4,gid=users,file_mode=0664,dir_mode=0775,sec=lanman,servern=SMA-SERVER1,nocase,noperm,nounix,noserverino 0 0 
#
sma-nas-02.sma.com:/volume1/pub-data    /t    nfs    defaults 0 0 
sma-nas-02.sma.com:/volume1/graphics    /w    nfs    defaults 0 0 
sma-nas-02.sma.com:/volume1/av-media    /v    nfs    defaults 0 0 
sma-nas-02.sma.com:/volume1/backup    /bkp    nfs    defaults 0 0 
#
sma-server3.sma.com:/data01/t-drv    /u    nfs    defaults 0 0 
sma-nas-02.sma.com:/volume1/Kyocera-scanner    /mnt/k-scanner    nfs    defaults 0 0 
#

Did you at least look inside /mnt/usr1 to check if it looks the same as what you see inside /usr? In other words, if your rsync action resulted in what you intended to do with it?

The original /usr is 11GB; the copied /usr is 11GB. The new one has all the same directories as the original.

The rsync transfer summary:

2015/03/28 11:31:02 [20663] Number of files: 445,108 (reg: 379,005, dir: 38,172, link: 27,931)
2015/03/28 11:31:02 [20663] Number of created files: 445,108 (reg: 379,005, dir: 38,172, link: 27,931)
2015/03/28 11:31:02 [20663] Number of deleted files: 0
2015/03/28 11:31:02 [20663] Number of regular files transferred: 363,903
2015/03/28 11:31:02 [20663] Total file size: 10,580,652,338 bytes
2015/03/28 11:31:02 [20663] Total transferred file size: 9,975,551,571 bytes
2015/03/28 11:31:02 [20663] Literal data: 9,975,551,571 bytes
2015/03/28 11:31:02 [20663] Matched data: 0 bytes
2015/03/28 11:31:02 [20663] File list size: 12,077,678
2015/03/28 11:31:02 [20663] File list generation time: 0.001 seconds
2015/03/28 11:31:02 [20663] File list transfer time: 0.000 seconds
2015/03/28 11:31:02 [20663] Total bytes sent: 10,006,096,246
2015/03/28 11:31:02 [20663] Total bytes received: 8,068,957
2015/03/28 11:31:02 [20663] sent 10,006,096,246 bytes  received 8,068,957 bytes  8,842,529.98 bytes/sec
2015/03/28 11:31:02 [20663] total size is 10,580,652,338  speedup is 1.06

That looks fine imho. My impression is that you are knowing what you are doing, but chcking everything when there is such a phenomenon as you have is not bad.

You checked that the copied size is OK, did you do a short check (upper level of the file system) if ownership/permission are alright? When that is OK, I assume we can be rather sure that it is OK further down the directory tree also.

I also assume that it is indeed ext4. Because you checked that by mounting on /mnt/usr1.

It stops during boot. Did you hit the Esc key to see what message are shown?

Also, nothing to find in logs about it?

opensuse 13.2
linux 3.16.7-7-desktop x86_64

Note: I posted this in the Applications forum. No joy there. One person suggested it might be an initrd problem but offered no details.

I recently purchased an Axiom SSD unit, 160GB. I partitioned it into two volumes, one for /usr, the other for / (root). I copied /usr using rsync:

OPTS='--recursive --one-file-system --links --stats --itemize-changes --quiet --delete --times -HAXS'; rsync ${OPTS} --log-file=${LOGFILE} /usr /mnt/usr1/

I thought that all I had to do then was modify /etc/fstab and restart. Not so. It became unbootable. I had to use the Rescue Disk to change the fstab settings back to the previous.


/dev/disk/by-id/scsi-SSEAGATE_ST336753LW_3HX0G0GM000073370Y4S-part3 /usr ext4 acl,user_xattr 1 2
# /dev/disk/by-id/scsi-SSEAGATE_ST336753LW_3HX0G0GM000073370Y4S-part3 /mnt/usr1  ext4  acl,user_xattr 1 2

/dev/disk/by-id/ata-Axiom_Signature_Series_III_SSD_AX150206AS1706441-part2 /mnt/usr1 xfs  defaults 1 2
# /dev/disk/by-id/ata-Axiom_Signature_Series_III_SSD_AX150206AS1706441-part2 /usr xfs defaults 1 2

So. What did I miss when copying /usr and changing mount points?

I was mystified in the earlier thread. So I’m still unsure what was the problem.

You probably also need to change “/etc/default/grub”, and then regenerate “grub.cfg”. But manually editing “/boot/grub2/grub.cfg” should be a sufficient temporary fix for that.

initrd must be regenerated; /usr must be present before switch root.

What are the steps to do so?

I tried modifying /etc/fstab for the new mount points, and running mkinitrd. Did not work.
I cannot change the mount point for /usr while the system is running.

Boot any live distribution, mount /, /boot and /usr, chroot, mkinitrd. Something like


mount /dev/your-root /mnt
mount /dev/your-user /mnt/usr
mount /dev/your-boot /mnt/boot
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
chroot /mnt mkinitrd

Attention please!

I merged the two threads. Double posting is not allowed and creates confusion.

It may be that the merged thread will also create some confusion, but at least we have now everything in on place.

As this system does not have a separate boot partition I changed the commands like so:

mount /dev/your-root /mnt
mount /dev/your-user /mnt/usr
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
chroot /mnt 
mkinitrd
exit

It worked! Thank you.
/usr is now running in the SSD volume. So cool!