Como Mover Una Carpeta Del Sistema En Suse Linux
danielrey6530 de Agosto de 2013
905 Palabras (4 Páginas)317 Visitas
A veces nos puede suceder que el espacio asignado originalmente al directorio raiz resulta poco.
Ejemplo
[root@server ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg-lv_root
4.9G 4.8G 0 100% /
Supongamos que el directorio que más consume sea el /usr y lo queremos mover a un disco nuevo
1) Necesitamos que el SO reconozca el disco sin reiniciar, para ello ejecutamos:
echo "- - -" > /sys/class/scsi_host/host2/scan
fdisk -l
tail -f /var/log/messages
El primer comando sirve para forzar un rescan de los discos. El segundo y el tercero nos sirven para saber cual es el identificador que el sistema asignó al nuevo disco, en nuestro caso fue /dev/sdd
2) Crear el filesystem
El disco asignado fue de 16Gbytes, lo cual es como mucho para el /usr, así que se decidió utilizar sólo 8Gbytes y reservar el resto para futuras necesidades.
Para ellos usamos los comandos fdisk y mkfs.ext3:
Procedemos con el comando fdisk
[root@server ~]# fdisk /dev/sdd
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): c
DOS Compatibility flag is not set
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1958, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1958, default 1958): +8G
Command (m for help): p
Disk /dev/sdd: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xec6f1e07
Device Boot Start End Blocks Id System
/dev/sdd1 1 1045 8392938 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@server ~]#
y a continuación formateamos la partición
[root@server ~]# /dev/sdd1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
525200 inodes, 2098234 blocks
104911 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2151677952
65 block groups
32768 blocks per group, 32768 fragments per group
8080 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
3) Punto de montaje alternativo
Agregamos una entrada en el /etc/fstab
[root@server ~]# diff /etc/fstab.ori /etc/fstab
16a17,18
> /dev/sdd1 /usr1 ext3 defaults 1 2
>
...